├── .gitattributes ├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE.md ├── README.md ├── RELEASE-NOTES.md ├── RELEASE.md ├── resources └── logo │ ├── shogun-logo-150px.png │ ├── shogun-logo-full-150px.png │ ├── shogun-logo-full.svg │ ├── shogun-logo.md │ └── shogun-logo.svg ├── scripts ├── release.sh ├── settings.xml └── snapshot-release.sh └── src ├── .editorconfig ├── checkstyle └── checkstyle.xml ├── pom.xml ├── shogun-core-main ├── pom.xml └── src │ ├── main │ └── java │ │ └── de │ │ └── terrestris │ │ └── shoguncore │ │ ├── converter │ │ ├── LayerIdResolver.java │ │ ├── ModuleIdResolver.java │ │ ├── PersistentObjectIdResolver.java │ │ ├── PluginIdResolver.java │ │ ├── PropertyValueConverter.java │ │ ├── TreeFolderIdResolver.java │ │ ├── TreeNodeIdResolver.java │ │ ├── UserGroupIdResolver.java │ │ └── WpsProcessExecuteIdResolver.java │ │ ├── dao │ │ ├── AbstractTokenDao.java │ │ ├── AbstractUserTokenDao.java │ │ ├── ApplicationDao.java │ │ ├── ButtonDao.java │ │ ├── ExtentDao.java │ │ ├── FileDao.java │ │ ├── GenericHibernateDao.java │ │ ├── ImageFileDao.java │ │ ├── InterceptorRuleDao.java │ │ ├── LayerAppearanceDao.java │ │ ├── LayerDao.java │ │ ├── LayerDataSourceDao.java │ │ ├── LayoutDao.java │ │ ├── MapConfigDao.java │ │ ├── MapControlDao.java │ │ ├── MapDao.java │ │ ├── ModuleDao.java │ │ ├── PasswordResetTokenDao.java │ │ ├── PermissionCollectionDao.java │ │ ├── PersonDao.java │ │ ├── PluginDao.java │ │ ├── RegistrationTokenDao.java │ │ ├── RoleDao.java │ │ ├── TerritoryDao.java │ │ ├── TileGridDao.java │ │ ├── TreeFolderDao.java │ │ ├── TreeNodeDao.java │ │ ├── UserDao.java │ │ ├── UserGroupDao.java │ │ ├── WpsParameterDao.java │ │ ├── WpsPluginDao.java │ │ ├── WpsPrimitiveDao.java │ │ ├── WpsProcessExecuteDao.java │ │ └── WpsReferenceDao.java │ │ ├── helper │ │ ├── CreatedHelper.java │ │ └── IdHelper.java │ │ ├── hibernate │ │ ├── JsonbUserType.java │ │ ├── ShogunPostgresqlDialect.java │ │ └── SimpleJsonbConverter.java │ │ ├── importer │ │ ├── GeoServerRESTImporter.java │ │ ├── GeoServerRESTImporterException.java │ │ ├── communication │ │ │ ├── AbstractRESTEntity.java │ │ │ ├── RESTAttribute.java │ │ │ ├── RESTBoundingBox.java │ │ │ ├── RESTCoverageStore.java │ │ │ ├── RESTData.java │ │ │ ├── RESTDataDirectory.java │ │ │ ├── RESTDataFile.java │ │ │ ├── RESTDataRemote.java │ │ │ ├── RESTDataStore.java │ │ │ ├── RESTImport.java │ │ │ ├── RESTImportTask.java │ │ │ ├── RESTImportTaskList.java │ │ │ ├── RESTLayer.java │ │ │ ├── RESTStore.java │ │ │ ├── RESTStyle.java │ │ │ ├── RESTTarget.java │ │ │ ├── RESTTargetDataStore.java │ │ │ ├── RESTTargetWorkspace.java │ │ │ └── RESTWorkspace.java │ │ └── transform │ │ │ ├── RESTDateFormatTransform.java │ │ │ ├── RESTGdalAddoTransform.java │ │ │ ├── RESTGdalTranslateTransform.java │ │ │ ├── RESTGdalWarpTransform.java │ │ │ ├── RESTReprojectTransform.java │ │ │ ├── RESTTransform.java │ │ │ └── RESTTransformChain.java │ │ ├── init │ │ └── ContentInitializer.java │ │ ├── model │ │ ├── Application.java │ │ ├── File.java │ │ ├── ImageFile.java │ │ ├── PersistentObject.java │ │ ├── Person.java │ │ ├── Plugin.java │ │ ├── Role.java │ │ ├── Territory.java │ │ ├── User.java │ │ ├── UserGroup.java │ │ ├── interceptor │ │ │ └── InterceptorRule.java │ │ ├── layer │ │ │ ├── Layer.java │ │ │ ├── appearance │ │ │ │ └── LayerAppearance.java │ │ │ ├── source │ │ │ │ ├── ImageWmsLayerDataSource.java │ │ │ │ ├── LayerDataSource.java │ │ │ │ ├── TileWmsLayerDataSource.java │ │ │ │ ├── WfsLayerDataSource.java │ │ │ │ ├── WmtsLayerDataSource.java │ │ │ │ └── XyzLayerDataSource.java │ │ │ └── util │ │ │ │ ├── Extent.java │ │ │ │ ├── TileGrid.java │ │ │ │ └── WmtsTileGrid.java │ │ ├── layout │ │ │ ├── AbsoluteLayout.java │ │ │ ├── BorderLayout.java │ │ │ └── Layout.java │ │ ├── map │ │ │ ├── MapConfig.java │ │ │ └── MapControl.java │ │ ├── module │ │ │ ├── AccordionPanel.java │ │ │ ├── Button.java │ │ │ ├── CompositeModule.java │ │ │ ├── CoordinateTransformation.java │ │ │ ├── Image.java │ │ │ ├── Map.java │ │ │ ├── Module.java │ │ │ ├── NominatimSearch.java │ │ │ ├── OverpassSearch.java │ │ │ ├── OverviewMap.java │ │ │ ├── Print.java │ │ │ └── WfsSearch.java │ │ ├── security │ │ │ ├── Permission.java │ │ │ └── PermissionCollection.java │ │ ├── token │ │ │ ├── PasswordResetToken.java │ │ │ ├── RegistrationToken.java │ │ │ ├── Token.java │ │ │ └── UserToken.java │ │ ├── tree │ │ │ ├── TreeFolder.java │ │ │ └── TreeNode.java │ │ └── wps │ │ │ ├── WpsParameter.java │ │ │ ├── WpsPlugin.java │ │ │ ├── WpsPrimitive.java │ │ │ ├── WpsProcessExecute.java │ │ │ └── WpsReference.java │ │ ├── paging │ │ └── PagingResult.java │ │ ├── rest │ │ ├── AbstractRestController.java │ │ ├── ApplicationRestController.java │ │ ├── ButtonRestController.java │ │ ├── ExtentRestController.java │ │ ├── ImageFileRestController.java │ │ ├── LayerAppearanceRestController.java │ │ ├── LayerDataSourceRestController.java │ │ ├── LayerRestController.java │ │ ├── LayoutRestController.java │ │ ├── MapConfigRestController.java │ │ ├── MapControlRestController.java │ │ ├── ModuleRestController.java │ │ ├── PluginRestController.java │ │ ├── RoleRestController.java │ │ ├── TileGridRestController.java │ │ ├── TreeNodeRestController.java │ │ ├── UserGroupRestController.java │ │ ├── UserRestController.java │ │ ├── WpsParameterRestController.java │ │ ├── WpsPluginRestController.java │ │ ├── WpsPrimitiveRestController.java │ │ ├── WpsProcessExecuteRestController.java │ │ └── WpsReferenceRestController.java │ │ ├── security │ │ ├── ShogunCoreAuthenticationProvider.java │ │ └── access │ │ │ ├── ShogunCorePermissionEvaluator.java │ │ │ ├── entity │ │ │ ├── AlwaysAllowReadPermissionEvaluator.java │ │ │ ├── PermissionCollectionPermissionEvaluator.java │ │ │ ├── PersistentObjectPermissionEvaluator.java │ │ │ ├── UserGroupPermissionEvaluator.java │ │ │ └── UserPermissionEvaluator.java │ │ │ └── factory │ │ │ └── EntityPermissionEvaluatorFactory.java │ │ ├── service │ │ ├── AbstractCrudService.java │ │ ├── AbstractDaoService.java │ │ ├── AbstractTokenService.java │ │ ├── AbstractUserTokenService.java │ │ ├── ApplicationService.java │ │ ├── ButtonService.java │ │ ├── Csv2ExtJsLocaleService.java │ │ ├── EndpointDocService.java │ │ ├── ExtentService.java │ │ ├── FileService.java │ │ ├── GeoServerInterceptorService.java │ │ ├── HttpProxyService.java │ │ ├── ImageFileService.java │ │ ├── InitializationService.java │ │ ├── InterceptorRuleService.java │ │ ├── LayerAppearanceService.java │ │ ├── LayerDataSourceService.java │ │ ├── LayerService.java │ │ ├── LayoutService.java │ │ ├── LdapService.java │ │ ├── MapConfigService.java │ │ ├── MapControlService.java │ │ ├── MapService.java │ │ ├── ModelDescriptionService.java │ │ ├── ModuleService.java │ │ ├── PasswordResetTokenService.java │ │ ├── PermissionAwareCrudService.java │ │ ├── PermissionCollectionService.java │ │ ├── PersonService.java │ │ ├── PluginService.java │ │ ├── RegistrationTokenService.java │ │ ├── RoleService.java │ │ ├── TileGridService.java │ │ ├── TreeFolderService.java │ │ ├── TreeNodeService.java │ │ ├── UserGroupService.java │ │ ├── UserService.java │ │ ├── WpsParameterService.java │ │ ├── WpsPluginService.java │ │ ├── WpsPrimitiveService.java │ │ ├── WpsProcessExecuteService.java │ │ └── WpsReferenceService.java │ │ ├── util │ │ ├── application │ │ │ └── ShogunCoreContextUtil.java │ │ ├── bean │ │ │ └── NullAwareBeanUtilsBean.java │ │ ├── config │ │ │ └── ConfigHolder.java │ │ ├── data │ │ │ └── ResultSet.java │ │ ├── dialect │ │ │ └── ShogunCoreOracleDialect.java │ │ ├── entity │ │ │ └── EntityUtil.java │ │ ├── enumeration │ │ │ ├── HttpEnum.java │ │ │ ├── InterceptorEnum.java │ │ │ └── OgcEnum.java │ │ ├── http │ │ │ └── HttpUtil.java │ │ ├── interceptor │ │ │ ├── CachedServletInputStream.java │ │ │ ├── GeoserverAuthHeaderRequest.java │ │ │ ├── InterceptorException.java │ │ │ ├── MutableHttpServletRequest.java │ │ │ ├── OgcMessage.java │ │ │ ├── OgcMessageDistributor.java │ │ │ ├── OgcXmlUtil.java │ │ │ ├── WcsRequestInterceptorInterface.java │ │ │ ├── WcsResponseInterceptorInterface.java │ │ │ ├── WfsRequestInterceptorInterface.java │ │ │ ├── WfsResponseInterceptorInterface.java │ │ │ ├── WmsRequestInterceptorInterface.java │ │ │ ├── WmsResponseInterceptorInterface.java │ │ │ ├── WmtsRequestInterceptorInterface.java │ │ │ ├── WmtsResponseInterceptorInterface.java │ │ │ ├── WmtsUtil.java │ │ │ ├── WpsRequestInterceptorInterface.java │ │ │ ├── WpsResponseInterceptorInterface.java │ │ │ ├── impl │ │ │ │ ├── WcsRequestInterceptor.java │ │ │ │ ├── WfsRequestInterceptor.java │ │ │ │ ├── WfsResponseInterceptor.java │ │ │ │ ├── WmsRequestInterceptor.java │ │ │ │ └── WpsRequestInterceptor.java │ │ │ ├── secure │ │ │ │ ├── BaseInterceptor.java │ │ │ │ ├── WfsRequestInterceptor.java │ │ │ │ ├── WfsResponseInterceptor.java │ │ │ │ ├── WmsRequestInterceptor.java │ │ │ │ ├── WmsResponseInterceptor.java │ │ │ │ ├── WmtsRequestInterceptor.java │ │ │ │ └── WmtsResponseInterceptor.java │ │ │ └── standard │ │ │ │ ├── WmsRequestInterceptor.java │ │ │ │ └── WmsResponseInterceptor.java │ │ ├── json │ │ │ └── ShogunCoreJsonObjectMapper.java │ │ ├── mail │ │ │ └── MailPublisher.java │ │ ├── model │ │ │ └── Response.java │ │ └── naming │ │ │ ├── ImplicitNamingStrategyShogunCore.java │ │ │ ├── OracleNamingStrategyShogunCore.java │ │ │ └── PhysicalNamingStrategyShogunCore.java │ │ └── web │ │ ├── AbstractWebController.java │ │ ├── ApplicationController.java │ │ ├── Csv2ExtJsLocaleController.java │ │ ├── EndpointDocController.java │ │ ├── FileController.java │ │ ├── GeoServerInterceptorController.java │ │ ├── HttpProxyController.java │ │ ├── ImageFileController.java │ │ ├── LayerController.java │ │ ├── MapController.java │ │ ├── ModelDescriptionController.java │ │ ├── ModuleController.java │ │ ├── PluginController.java │ │ ├── TreeNodeController.java │ │ ├── UserController.java │ │ ├── WpsParameterController.java │ │ ├── WpsPluginController.java │ │ ├── WpsPrimitiveController.java │ │ ├── WpsProcessExecuteController.java │ │ └── WpsReferenceController.java │ └── test │ ├── java │ ├── META-INF │ │ └── MANIFEST.MF │ └── de │ │ └── terrestris │ │ └── shoguncore │ │ ├── converter │ │ └── PropertyValueConverterTest.java │ │ ├── dao │ │ └── GenericHibernateDaoTest.java │ │ ├── importer │ │ └── GeoServerRESTImporterTest.java │ │ ├── init │ │ └── ContentInitializerTest.java │ │ ├── rest │ │ └── AbstractRestControllerTest.java │ │ ├── security │ │ ├── ShogunCoreAuthenticationProviderTest.java │ │ └── access │ │ │ ├── ShogunCorePermissionEvaluatorTest.java │ │ │ ├── entity │ │ │ ├── AbstractPersistentObjectPermissionEvaluatorTest.java │ │ │ ├── ApplicationPermissionEvaluatorTest.java │ │ │ ├── LayoutPermissionEvaluatorTest.java │ │ │ ├── UserGroupPermissionEvaluatorTest.java │ │ │ └── UserPermissionEvaluatorTest.java │ │ │ └── factory │ │ │ └── EntityPermissionEvaluatorFactoryTest.java │ │ ├── service │ │ ├── AbstractCrudServiceTest.java │ │ ├── AbstractUserTokenServiceTest.java │ │ ├── ApplicationServiceTest.java │ │ ├── Csv2ExtJsLocaleServiceTest.java │ │ ├── FileServiceTest.java │ │ ├── GeoServerInterceptorServiceTest.java │ │ ├── HttpProxyServiceTest.java │ │ ├── ImageFileServiceTest.java │ │ ├── PasswordResetTokenServiceTest.java │ │ ├── PermissionAwareCrudServiceTest.java │ │ ├── PermissionCollectionServiceTest.java │ │ ├── PersonServiceTest.java │ │ ├── RegistrationTokenServiceTest.java │ │ ├── RoleServiceTest.java │ │ ├── UserGroupServiceTest.java │ │ └── UserServiceTest.java │ │ ├── util │ │ ├── application │ │ │ └── ShogunCoreContextUtilTest.java │ │ ├── data │ │ │ └── ResultSetTest.java │ │ ├── entity │ │ │ └── EntityUtilTest.java │ │ ├── http │ │ │ └── HttpUtilTest.java │ │ ├── interceptor │ │ │ ├── InterceptorExceptionTest.java │ │ │ ├── MutableHttpServletRequestTest.java │ │ │ ├── OgcMessageDistributorTest.java │ │ │ ├── OgcMessageTest.java │ │ │ └── OgcXmlUtilTest.java │ │ ├── json │ │ │ └── ShogunCoreJsonObjectMapperTest.java │ │ ├── mail │ │ │ └── MailPublisherTest.java │ │ └── naming │ │ │ ├── ImplicitNamingStrategyShogunCoreTest.java │ │ │ ├── OracleNamingStrategyShogunCoreTest.java │ │ │ └── PhysicalNamingStrategyShogunCoreTest.java │ │ └── web │ │ ├── ApplicationControllerTest.java │ │ ├── Csv2ExtJsLocaleControllerTest.java │ │ ├── EndpointDocControllerTest.java │ │ ├── FileControllerTest.java │ │ ├── GeoServerInterceptorControllerTest.java │ │ ├── HttpProxyControllerTest.java │ │ ├── ImageFileControllerTest.java │ │ ├── MapControllerTest.java │ │ ├── ModelDescriptionControllerTest.java │ │ ├── ModuleControllerTest.java │ │ ├── PluginControllerTest.java │ │ ├── TreeNodeControllerTest.java │ │ ├── UserControllerTest.java │ │ ├── WpsParameterControllerTest.java │ │ ├── WpsPluginControllerTest.java │ │ ├── WpsPrimitiveControllerTest.java │ │ └── WpsProcessExecuteControllerTest.java │ └── resources │ ├── META-INF │ ├── hibernate.properties │ ├── hikari.properties │ ├── jdbc.properties │ ├── locale │ │ ├── component_empty.csv │ │ ├── empty.csv │ │ ├── field_empty.csv │ │ ├── field_unsupported_array.csv │ │ ├── invalid.csv │ │ └── test.csv │ ├── logo.png │ ├── shogun2.properties │ └── spring │ │ ├── mail-test-context.xml │ │ ├── test-context-dao.xml │ │ ├── test-encoder-bean.xml │ │ └── test-locale.xml │ └── log4j2.xml ├── shogun-core-webapp-archetype ├── pom.xml └── src │ ├── main │ └── resources │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype-metadata.xml │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ ├── dao │ │ │ └── ProjectApplicationDao.java │ │ ├── init │ │ │ └── ProjectContentInitializer.java │ │ ├── model │ │ │ └── ProjectApplication.java │ │ ├── rest │ │ │ └── ProjectApplicationRestController.java │ │ ├── security │ │ │ └── access │ │ │ │ ├── entity │ │ │ │ └── ProjectApplicationPermissionEvaluator.java │ │ │ │ └── factory │ │ │ │ └── ProjectEntityPermissionEvaluatorFactory.java │ │ ├── service │ │ │ └── ProjectApplicationService.java │ │ ├── util │ │ │ ├── WcsRequestInterceptor.java │ │ │ ├── WcsResponseInterceptor.java │ │ │ ├── WfsRequestInterceptor.java │ │ │ ├── WfsResponseInterceptor.java │ │ │ ├── WmsRequestInterceptor.java │ │ │ └── WmsResponseInterceptor.java │ │ └── web │ │ │ └── ProjectApplicationController.java │ │ ├── resources │ │ ├── META-INF │ │ │ ├── __artifactId__-init.properties │ │ │ ├── __artifactId__.properties │ │ │ ├── env.properties │ │ │ ├── geoServerNameSpaces.properties │ │ │ ├── hibernate.properties │ │ │ ├── hikari.properties │ │ │ ├── jdbc.properties │ │ │ ├── proxy.properties │ │ │ └── spring │ │ │ │ ├── __artifactId__-context-db.xml │ │ │ │ ├── __artifactId__-context-init.xml │ │ │ │ ├── __artifactId__-context-initialize-beans.xml │ │ │ │ ├── __artifactId__-context-security.xml │ │ │ │ └── __artifactId__-context.xml │ │ ├── ehcache.xml │ │ └── log4j2.xml │ │ └── webapp │ │ ├── WEB-INF │ │ ├── __artifactId__-servlet.xml │ │ └── web.xml │ │ └── index.html │ └── test │ └── resources │ └── projects │ └── basic │ ├── archetype.properties │ └── goal.txt └── spotbugs └── spotbugs-exclude.xml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Credits go to https://github.com/Danimoth/gitattributes 2 | # See also http://stackoverflow.com/a/10855862 3 | 4 | # Handle line endings automatically for files detected as text 5 | # and leave all files detected as binary untouched. 6 | * text=auto 7 | 8 | # 9 | # The above will handle all files NOT found below 10 | # 11 | # These files are text and should be normalized (Convert crlf => lf) 12 | *.css text 13 | *.df text 14 | *.htm text 15 | *.html text 16 | *.java text 17 | *.js text 18 | *.json text 19 | *.jsp text 20 | *.jspf text 21 | *.properties text 22 | *.sh text 23 | *.svg text 24 | *.tld text 25 | *.txt text 26 | *.xml text 27 | 28 | # These files are binary and should be left untouched 29 | # (binary is a macro for -text -diff) 30 | *.class binary 31 | *.dll binary 32 | *.ear binary 33 | *.gif binary 34 | *.ico binary 35 | *.jar binary 36 | *.jpg binary 37 | *.jpeg binary 38 | *.png binary 39 | *.so binary 40 | *.war binary 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | target 3 | tmp 4 | .wtpmodules 5 | pom.xml.tag 6 | pom.xml.releaseBackup 7 | pom.xml.versionsBackup 8 | pom.xml.next 9 | release.properties 10 | 11 | ### IDE specific files to ignore ### 12 | ##### Eclipse ##### 13 | .classpath 14 | .project 15 | .settings/ 16 | 17 | ##### Intellij ##### 18 | .idea/ 19 | *.iml 20 | *.iws 21 | 22 | ##### Visual Studio Code ##### 23 | .vscode 24 | .factorypath 25 | 26 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "doc"] 2 | path = doc 3 | url = https://github.com/terrestris/shogun-core.wiki.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | cache: 4 | directories: 5 | - "$HOME/.m2" 6 | sudo: false 7 | 8 | env: 9 | global: 10 | - secure: Njr6RXyoqC3fJuuKCXD9h02UoKXDy9JOLNFT7aqYx7ALmfaqJ22zXRAKjGd4LxRL4EZfnHEHuF8IlLFf2kjEUdTN9jnLYmVfUXgrjn2jzdcXOMrHh+g1DarVERa8uyn4Smnqqr/PJtONjhmhQprEN9z8e2kEWE4tI7pNv5mPycU= 11 | - secure: QB/e970WId8+N6wxnyzPAbKf46xKmnf4rYWUw53N6F2qHwFZpih1PiiQI4UgOxVKz4MeYMm4eF1LWKz7Dlfdl9ULcvN+D5j1s+fgHb+qeqnAAlCiT5iZ5iCb/EZq6YLHJauNarryuF5WFIwMtbx25r+ULCCwD4Rg/O2sa9WOyJc= 12 | before_install: 13 | - wget https://raw.githubusercontent.com/sormuras/bach/master/install-jdk.sh 14 | - chmod 755 install-jdk.sh 15 | matrix: 16 | include: 17 | - env: JDK='openjdk8' 18 | install: echo 'using built in jdk' 19 | - env: JDK='openjdk11' 20 | install: ./install-jdk.sh -f 11 21 | before_script: 22 | - cd src/ 23 | - export JAVA_HOME=$(for file in $HOME/*jdk*; do if (test -d "$file") then echo $file; fi; done) 24 | - mvn -v 25 | - mvn --batch-mode -DskipTests=true install 26 | script: 27 | - mvn -v 28 | - export JAVA_HOME=$(for file in $HOME/*jdk*; do if (test -d "$file") then echo $file; fi; done) 29 | - mvn --batch-mode --show-version clean test 30 | after_success: 31 | - mvn clean test jacoco:report coveralls:report 32 | - "../scripts/snapshot-release.sh" 33 | after_script: 34 | - cd .. 35 | notifications: 36 | email: 37 | on_success: never 38 | on_failure: never 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![The SHOGun-Core logo](resources/logo/shogun-logo-full-150px.png "SHOGun-Core") 2 | 3 | # SHOGun-Core 4 | 5 | [![Build Status](https://travis-ci.org/terrestris/shogun-core.svg?branch=master)](https://travis-ci.org/terrestris/shogun-core?branch=master) [![Coverage Status](https://coveralls.io/repos/terrestris/shogun-core/badge.svg?branch=master)](https://coveralls.io/r/terrestris/shogun-core?branch=master) 6 | 7 | SHOGun-Core is the framework used to build SHOGun, based on several high-quality Open Source frameworks. 8 | 9 | Everything you need to know about SHOGun-Core or how you can start with developing is documented in the [wiki of this project](https://github.com/terrestris/shogun-core/wiki). 10 | 11 | #### How to pull updated doc/wiki? 12 | 13 | On the shogun-core **root directory** (if wiki/doc has been changed): 14 | 15 | 0. If the submodule has not yet been initialized: `git submodule update --init --recursive` 16 | 1. `git submodule foreach git pull origin master` 17 | 2. `git add ...` 18 | 3. `git commit` 19 | 4. `git push ...` 20 | -------------------------------------------------------------------------------- /resources/logo/shogun-logo-150px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrestris/shogun-core/d1881aa2f2c41d00d308ff7f794c34c76dd5a925/resources/logo/shogun-logo-150px.png -------------------------------------------------------------------------------- /resources/logo/shogun-logo-full-150px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrestris/shogun-core/d1881aa2f2c41d00d308ff7f794c34c76dd5a925/resources/logo/shogun-logo-full-150px.png -------------------------------------------------------------------------------- /resources/logo/shogun-logo.md: -------------------------------------------------------------------------------- 1 | # Metadata SHOGun2 logo 2 | 3 | Original design by Marc Jansen and Daniel Koch. 4 | 5 | ## Font 6 | * Sansita (for Print) 7 | * Design: Pablo Cosgaya & Omnibus-Type Team 8 | * License: SIL Open Font License, 1.1 9 | * Further details and download [here](http://omnibus-type.com/fonts/sansita.php) 10 | or [here](http://www.fontsquirrel.com/fonts/sansita) 11 | 12 | ## Colors 13 | * Leaf: 14 | * *Hex:* #70B3BE 15 | * *RGB:* rgb(112, 179, 190) 16 | * Font and circle in leaf: 17 | * *Hex:* #59666C 18 | * *RGB:* rgb(89, 102, 108) 19 | 20 | ## Design ideas 21 | 22 | * the leaf is inspired by the leaf on the Spring logo 23 | * the cog silhouette is inspired by the cogs on the GeoExt logo 24 | * the color of the leaf is the color of the darker part on the top most layer 25 | of the OpenLayers logo 26 | * the small circle (the inner part of the cog) can also be interpreted as a 27 | globe; adding the geo-connection 28 | 29 | -------------------------------------------------------------------------------- /scripts/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # stop at first command failure 4 | set -e 5 | 6 | read -p "Do you really want to deploy to maven central repository (y/n)? " 7 | 8 | # check if prompted to continue 9 | if [[ ! $REPLY =~ ^[Yy]$ ]]; then 10 | exit 1 11 | fi 12 | 13 | # check if the input parameter RELEASE_VERSION is valid 14 | RELEASE_VERSION="$1" 15 | if [[ ! $RELEASE_VERSION =~ ^([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then 16 | echo "Error: RELEASE_VERSION must be in X.Y.Z format, but was $RELEASE_VERSION" 17 | exit 1 18 | fi 19 | 20 | # check if the input parameter DEVELOPMENT_VERSION is valid 21 | DEVELOPMENT_VERSION="$2" 22 | if [[ ! $DEVELOPMENT_VERSION =~ ^([0-9]+\.[0-9]+\.[0-9]+)(\-SNAPSHOT)$ ]]; then 23 | echo "Error: DEVELOPMENT_VERSION must be in X.Y.Z-SNAPSHOT format, but was $DEVELOPMENT_VERSION" 24 | exit 1 25 | fi 26 | 27 | SCRIPTDIR=`dirname "$0"` 28 | 29 | pushd $SCRIPTDIR/../src/ 30 | 31 | mvn release:clean 32 | mvn release:prepare --batch-mode -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Darguments="-DskipTests" 33 | mvn release:perform --batch-mode 34 | 35 | popd 36 | -------------------------------------------------------------------------------- /scripts/settings.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | nexus.terrestris.de 14 | ${env.DEPLOY_USERNAME} 15 | ${env.DEPLOY_PASSWORD} 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /scripts/snapshot-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # stop at first command failure 4 | set -e 5 | 6 | if [ "$TRAVIS" != "true" ]; then 7 | echo "This script is supposed to be run inside the travis environment." 8 | exit 1 9 | fi 10 | 11 | if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then 12 | # only proceed if we were called by a merge (and not by a PR request) 13 | exit 1 14 | fi 15 | 16 | if [ "$TRAVIS_BRANCH" != "master" ]; then 17 | # only proceed if the target branch is master 18 | exit 1 19 | fi 20 | 21 | if [ "$TRAVIS_JDK_VERSION" != "oraclejdk8" ]; then 22 | # only proceed if the target JDK is oraclejdk8 23 | exit 1 24 | fi 25 | 26 | SCRIPTDIR=`dirname "$0"` 27 | 28 | SETTINGSFILE=$SCRIPTDIR/settings.xml 29 | 30 | mvn clean deploy --settings $SETTINGSFILE 31 | -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | indent_style = space 8 | indent_size = 4 9 | charset = utf-8 10 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/converter/LayerIdResolver.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.converter; 2 | 3 | import de.terrestris.shoguncore.dao.LayerDao; 4 | import de.terrestris.shoguncore.model.layer.Layer; 5 | import de.terrestris.shoguncore.service.LayerService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | 9 | /** 10 | * @author Nils Buehner 11 | */ 12 | public class LayerIdResolver, S extends LayerService> extends 13 | PersistentObjectIdResolver { 14 | 15 | @Override 16 | @Autowired 17 | @Qualifier("layerService") 18 | public void setService(S service) { 19 | this.service = service; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/converter/ModuleIdResolver.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.converter; 2 | 3 | import de.terrestris.shoguncore.dao.ModuleDao; 4 | import de.terrestris.shoguncore.model.module.Module; 5 | import de.terrestris.shoguncore.service.ModuleService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | 9 | /** 10 | * An ID resolver for {@link Module}s when deserializing only on the base of ID values. Based on a given ID, this 11 | * resolver will load the whole entity from the database. Extends the default implementation. 12 | * 13 | * @author Andre Henn 14 | */ 15 | public class ModuleIdResolver, S extends ModuleService> extends 16 | PersistentObjectIdResolver { 17 | 18 | @Override 19 | @Autowired 20 | @Qualifier("moduleService") 21 | public void setService(S service) { 22 | this.service = service; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/converter/PluginIdResolver.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.converter; 2 | 3 | import de.terrestris.shoguncore.dao.PluginDao; 4 | import de.terrestris.shoguncore.model.Plugin; 5 | import de.terrestris.shoguncore.service.PluginService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | 9 | /** 10 | * @author Nils Buehner 11 | */ 12 | public class PluginIdResolver, S extends PluginService> extends 13 | PersistentObjectIdResolver { 14 | 15 | @Override 16 | @Autowired 17 | @Qualifier("pluginService") 18 | public void setService(S service) { 19 | this.service = service; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/converter/TreeFolderIdResolver.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.converter; 2 | 3 | import de.terrestris.shoguncore.dao.TreeFolderDao; 4 | import de.terrestris.shoguncore.model.tree.TreeFolder; 5 | import de.terrestris.shoguncore.service.TreeFolderService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | 9 | /** 10 | * @author Nils Buehner 11 | */ 12 | public class TreeFolderIdResolver, S extends TreeFolderService> extends 13 | PersistentObjectIdResolver { 14 | 15 | @Override 16 | @Autowired 17 | @Qualifier("treeFolderService") 18 | public void setService(S service) { 19 | this.service = service; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/converter/TreeNodeIdResolver.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.converter; 2 | 3 | import de.terrestris.shoguncore.dao.TreeNodeDao; 4 | import de.terrestris.shoguncore.model.tree.TreeNode; 5 | import de.terrestris.shoguncore.service.TreeNodeService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | 9 | /** 10 | * @author Nils Buehner 11 | */ 12 | public class TreeNodeIdResolver, S extends TreeNodeService> extends 13 | PersistentObjectIdResolver { 14 | 15 | @Override 16 | @Autowired 17 | @Qualifier("treeNodeService") 18 | public void setService(S service) { 19 | this.service = service; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/converter/UserGroupIdResolver.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.converter; 2 | 3 | import de.terrestris.shoguncore.dao.UserGroupDao; 4 | import de.terrestris.shoguncore.model.UserGroup; 5 | import de.terrestris.shoguncore.service.UserGroupService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | 9 | /** 10 | * @author Nils Buehner 11 | */ 12 | public class UserGroupIdResolver, S extends UserGroupService> extends 13 | PersistentObjectIdResolver { 14 | 15 | @Override 16 | @Autowired 17 | @Qualifier("userGroupService") 18 | public void setService(S service) { 19 | this.service = service; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/converter/WpsProcessExecuteIdResolver.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.converter; 2 | 3 | import de.terrestris.shoguncore.dao.WpsProcessExecuteDao; 4 | import de.terrestris.shoguncore.model.wps.WpsProcessExecute; 5 | import de.terrestris.shoguncore.service.WpsProcessExecuteService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | 9 | /** 10 | * @param 11 | * @param 12 | * @param 13 | * @author Daniel Koch 14 | * @author terrestris GmbH & Co. KG 15 | */ 16 | public class WpsProcessExecuteIdResolver, 17 | S extends WpsProcessExecuteService> extends 18 | PersistentObjectIdResolver { 19 | 20 | @Override 21 | @Autowired 22 | @Qualifier("wpsProcessExecuteService") 23 | public void setService(S service) { 24 | this.service = service; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/AbstractTokenDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.token.Token; 4 | import org.springframework.stereotype.Repository; 5 | 6 | /** 7 | * As the {@link Token} class is abstract, this class will also be abstract. 8 | * There will also be NO {@link Repository} annotation here. 9 | * 10 | * @param 11 | * @author Nils Bühner 12 | */ 13 | public abstract class AbstractTokenDao extends 14 | GenericHibernateDao { 15 | 16 | /** 17 | * Constructor that has to be called by subclasses. 18 | * 19 | * @param clazz 20 | */ 21 | protected AbstractTokenDao(Class clazz) { 22 | super(clazz); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/AbstractUserTokenDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.token.UserToken; 4 | import org.springframework.stereotype.Repository; 5 | 6 | /** 7 | * As the {@link UserToken} class is abstract, this class will also be abstract. 8 | * There will also be NO {@link Repository} annotation here. 9 | * 10 | * @param 11 | * @author Nils Bühner 12 | */ 13 | public abstract class AbstractUserTokenDao extends 14 | AbstractTokenDao { 15 | 16 | /** 17 | * Constructor that has to be called by subclasses. 18 | * 19 | * @param clazz 20 | */ 21 | protected AbstractUserTokenDao(Class clazz) { 22 | super(clazz); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/ApplicationDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.Application; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("applicationDao") 7 | public class ApplicationDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public ApplicationDao() { 15 | super((Class) Application.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected ApplicationDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/ButtonDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.module.Button; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("buttonDao") 7 | public class ButtonDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public ButtonDao() { 15 | super((Class) Button.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected ButtonDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/ExtentDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.layer.util.Extent; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("extentDao") 7 | public class ExtentDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public ExtentDao() { 15 | super((Class) Extent.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected ExtentDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/FileDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.File; 4 | import org.springframework.stereotype.Repository; 5 | 6 | 7 | /** 8 | * @author Johannes Weskamm 9 | */ 10 | @Repository("fileDao") 11 | public class FileDao 12 | extends GenericHibernateDao { 13 | 14 | /** 15 | * Public default constructor for this DAO. 16 | */ 17 | @SuppressWarnings("unchecked") 18 | public FileDao() { 19 | super((Class) File.class); 20 | } 21 | 22 | /** 23 | * Constructor that has to be called by subclasses. 24 | * 25 | * @param clazz 26 | */ 27 | protected FileDao(Class clazz) { 28 | super(clazz); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/ImageFileDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.File; 4 | import de.terrestris.shoguncore.model.ImageFile; 5 | import org.springframework.stereotype.Repository; 6 | 7 | 8 | /** 9 | * @author Johannes Weskamm 10 | */ 11 | @Repository("imageFileDao") 12 | public class ImageFileDao 13 | extends FileDao { 14 | 15 | /** 16 | * Public default constructor for this DAO. 17 | */ 18 | @SuppressWarnings("unchecked") 19 | public ImageFileDao() { 20 | super((Class) ImageFile.class); 21 | } 22 | 23 | /** 24 | * Constructor that has to be called by subclasses. 25 | * 26 | * @param clazz 27 | */ 28 | protected ImageFileDao(Class clazz) { 29 | super(clazz); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/LayerAppearanceDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.layer.appearance.LayerAppearance; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("layerAppearanceDao") 7 | public class LayerAppearanceDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public LayerAppearanceDao() { 15 | super((Class) LayerAppearance.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected LayerAppearanceDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/LayerDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.layer.Layer; 4 | import org.springframework.stereotype.Repository; 5 | 6 | /** 7 | * @param 8 | * @author Nils Bühner 9 | */ 10 | @Repository("layerDao") 11 | public class LayerDao extends 12 | GenericHibernateDao { 13 | 14 | /** 15 | * Public default constructor for this DAO. 16 | */ 17 | @SuppressWarnings("unchecked") 18 | public LayerDao() { 19 | super((Class) Layer.class); 20 | } 21 | 22 | /** 23 | * Constructor that has to be called by subclasses. 24 | * 25 | * @param clazz 26 | */ 27 | protected LayerDao(Class clazz) { 28 | super(clazz); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/LayerDataSourceDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.layer.source.LayerDataSource; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("layerDataSourceDao") 7 | public class LayerDataSourceDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public LayerDataSourceDao() { 15 | super((Class) LayerDataSource.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected LayerDataSourceDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/LayoutDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.layout.Layout; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("layoutDao") 7 | public class LayoutDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public LayoutDao() { 15 | super((Class) Layout.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected LayoutDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/MapConfigDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.map.MapConfig; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("mapConfigDao") 7 | public class MapConfigDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public MapConfigDao() { 15 | super((Class) MapConfig.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected MapConfigDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/MapControlDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.map.MapControl; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("mapControlDao") 7 | public class MapControlDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public MapControlDao() { 15 | super((Class) MapControl.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected MapControlDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/MapDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.layer.Layer; 4 | import de.terrestris.shoguncore.model.module.Map; 5 | import org.hibernate.HibernateException; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.HashSet; 9 | import java.util.List; 10 | import java.util.Set; 11 | 12 | @Repository("mapDao") 13 | public class MapDao extends 14 | ModuleDao { 15 | 16 | /** 17 | * Public default constructor for this DAO. 18 | */ 19 | @SuppressWarnings("unchecked") 20 | public MapDao() { 21 | super((Class) Map.class); 22 | } 23 | 24 | /** 25 | * Constructor that has to be called by subclasses. 26 | * 27 | * @param clazz 28 | */ 29 | protected MapDao(Class clazz) { 30 | super(clazz); 31 | } 32 | 33 | /** 34 | * 35 | */ 36 | public Set findMapsWithLayer(Layer layer) throws HibernateException { 37 | final List resultList = this.findAllWithCollectionContaining("mapLayers", layer); 38 | return new HashSet<>(resultList); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/ModuleDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.module.Module; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("moduleDao") 7 | public class ModuleDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public ModuleDao() { 15 | super((Class) Module.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected ModuleDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/PasswordResetTokenDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.token.PasswordResetToken; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("passwordResetTokenDao") 7 | public class PasswordResetTokenDao extends 8 | AbstractUserTokenDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public PasswordResetTokenDao() { 15 | super((Class) PasswordResetToken.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected PasswordResetTokenDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/PermissionCollectionDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.security.PermissionCollection; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("permissionCollectionDao") 7 | public class PermissionCollectionDao extends GenericHibernateDao { 8 | 9 | /** 10 | * Public default constructor for this DAO. 11 | */ 12 | @SuppressWarnings("unchecked") 13 | public PermissionCollectionDao() { 14 | super((Class) PermissionCollection.class); 15 | } 16 | 17 | /** 18 | * Constructor that has to be called by subclasses. 19 | * 20 | * @param clazz 21 | */ 22 | protected PermissionCollectionDao(Class clazz) { 23 | super(clazz); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/PersonDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.Person; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("personDao") 7 | public class PersonDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public PersonDao() { 15 | super((Class) Person.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected PersonDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/PluginDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.Plugin; 4 | import org.springframework.stereotype.Repository; 5 | 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | @Repository("pluginDao") 11 | public class PluginDao 12 | extends GenericHibernateDao { 13 | 14 | /** 15 | * Public default constructor for this DAO. 16 | */ 17 | @SuppressWarnings("unchecked") 18 | public PluginDao() { 19 | super((Class) Plugin.class); 20 | } 21 | 22 | /** 23 | * Constructor that has to be called by subclasses. 24 | * 25 | * @param clazz 26 | */ 27 | protected PluginDao(Class clazz) { 28 | super(clazz); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/RegistrationTokenDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.token.RegistrationToken; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("registrationTokenDao") 7 | public class RegistrationTokenDao extends 8 | AbstractUserTokenDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public RegistrationTokenDao() { 15 | super((Class) RegistrationToken.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected RegistrationTokenDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/RoleDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.Role; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("roleDao") 7 | public class RoleDao extends GenericHibernateDao { 8 | 9 | /** 10 | * Public default constructor for this DAO. 11 | */ 12 | @SuppressWarnings("unchecked") 13 | public RoleDao() { 14 | super((Class) Role.class); 15 | } 16 | 17 | /** 18 | * Constructor that has to be called by subclasses. 19 | * 20 | * @param clazz 21 | */ 22 | protected RoleDao(Class clazz) { 23 | super(clazz); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/TerritoryDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.Territory; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("territoryDao") 7 | public class TerritoryDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public TerritoryDao() { 15 | super((Class) Territory.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected TerritoryDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/TileGridDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.layer.util.TileGrid; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("tileGridDao") 7 | public class TileGridDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public TileGridDao() { 15 | super((Class) TileGrid.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected TileGridDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/TreeFolderDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.tree.TreeFolder; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("treeFolderDao") 7 | public class TreeFolderDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public TreeFolderDao() { 15 | super((Class) TreeFolder.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected TreeFolderDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/TreeNodeDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.tree.TreeNode; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("treeNodeDao") 7 | public class TreeNodeDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public TreeNodeDao() { 15 | super((Class) TreeNode.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected TreeNodeDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.User; 4 | import org.hibernate.criterion.Restrictions; 5 | import org.hibernate.criterion.SimpleExpression; 6 | import org.springframework.stereotype.Repository; 7 | 8 | @Repository("userDao") 9 | public class UserDao extends PersonDao { 10 | 11 | /** 12 | * Public default constructor for this DAO. 13 | */ 14 | @SuppressWarnings("unchecked") 15 | public UserDao() { 16 | super((Class) User.class); 17 | } 18 | 19 | /** 20 | * Constructor that has to be called by subclasses. 21 | * 22 | * @param clazz 23 | */ 24 | protected UserDao(Class clazz) { 25 | super(clazz); 26 | } 27 | 28 | /** 29 | * @param accountName 30 | * @return 31 | */ 32 | public E findByAccountName(String accountName) { 33 | SimpleExpression eqAccountName = 34 | Restrictions.eq("accountName", accountName); 35 | return this.findByUniqueCriteria(eqAccountName); 36 | } 37 | 38 | /** 39 | * @param email 40 | * @return 41 | */ 42 | public E findByEmail(String email) { 43 | SimpleExpression eqEmail = Restrictions.eq("email", email); 44 | return this.findByUniqueCriteria(eqEmail); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/UserGroupDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.UserGroup; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository("userGroupDao") 7 | public class UserGroupDao extends 8 | GenericHibernateDao { 9 | 10 | /** 11 | * Public default constructor for this DAO. 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public UserGroupDao() { 15 | super((Class) UserGroup.class); 16 | } 17 | 18 | /** 19 | * Constructor that has to be called by subclasses. 20 | * 21 | * @param clazz 22 | */ 23 | protected UserGroupDao(Class clazz) { 24 | super(clazz); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/WpsParameterDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.wps.WpsParameter; 4 | import org.springframework.stereotype.Repository; 5 | 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | @Repository("wpsParameterDao") 11 | public class WpsParameterDao 12 | extends GenericHibernateDao { 13 | 14 | /** 15 | * Public default constructor for this DAO. 16 | */ 17 | @SuppressWarnings("unchecked") 18 | public WpsParameterDao() { 19 | super((Class) WpsParameter.class); 20 | } 21 | 22 | /** 23 | * Constructor that has to be called by subclasses. 24 | * 25 | * @param clazz 26 | */ 27 | protected WpsParameterDao(Class clazz) { 28 | super(clazz); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/WpsPluginDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.wps.WpsPlugin; 4 | import org.springframework.stereotype.Repository; 5 | 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | @Repository("wpsPluginDao") 11 | public class WpsPluginDao extends PluginDao { 12 | 13 | /** 14 | * Public default constructor for this DAO. 15 | */ 16 | @SuppressWarnings("unchecked") 17 | public WpsPluginDao() { 18 | super((Class) WpsPlugin.class); 19 | } 20 | 21 | /** 22 | * Constructor that has to be called by subclasses. 23 | * 24 | * @param clazz 25 | */ 26 | protected WpsPluginDao(Class clazz) { 27 | super(clazz); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/WpsPrimitiveDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.wps.WpsPrimitive; 4 | import org.springframework.stereotype.Repository; 5 | 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | @Repository("wpsPrimitiveDao") 11 | public class WpsPrimitiveDao extends WpsParameterDao { 12 | 13 | /** 14 | * Public default constructor for this DAO. 15 | */ 16 | @SuppressWarnings("unchecked") 17 | public WpsPrimitiveDao() { 18 | super((Class) WpsPrimitive.class); 19 | } 20 | 21 | /** 22 | * Constructor that has to be called by subclasses. 23 | * 24 | * @param clazz 25 | */ 26 | protected WpsPrimitiveDao(Class clazz) { 27 | super(clazz); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/WpsProcessExecuteDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.wps.WpsProcessExecute; 4 | import org.springframework.stereotype.Repository; 5 | 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | @Repository("wpsProcessExecuteDao") 11 | public class WpsProcessExecuteDao extends WpsReferenceDao { 12 | 13 | /** 14 | * Public default constructor for this DAO. 15 | */ 16 | @SuppressWarnings("unchecked") 17 | public WpsProcessExecuteDao() { 18 | super((Class) WpsProcessExecute.class); 19 | } 20 | 21 | /** 22 | * Constructor that has to be called by subclasses. 23 | * 24 | * @param clazz 25 | */ 26 | protected WpsProcessExecuteDao(Class clazz) { 27 | super(clazz); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/WpsReferenceDao.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.dao; 2 | 3 | import de.terrestris.shoguncore.model.wps.WpsReference; 4 | import org.springframework.stereotype.Repository; 5 | 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | @Repository("wpsReferenceDao") 11 | public class WpsReferenceDao extends WpsParameterDao { 12 | 13 | /** 14 | * Public default constructor for this DAO. 15 | */ 16 | @SuppressWarnings("unchecked") 17 | public WpsReferenceDao() { 18 | super((Class) WpsReference.class); 19 | } 20 | 21 | /** 22 | * Constructor that has to be called by subclasses. 23 | * 24 | * @param clazz 25 | */ 26 | protected WpsReferenceDao(Class clazz) { 27 | super(clazz); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/helper/IdHelper.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.helper; 2 | 3 | import de.terrestris.shoguncore.model.PersistentObject; 4 | import org.apache.logging.log4j.Logger; 5 | 6 | import java.lang.reflect.Field; 7 | import java.security.AccessController; 8 | import java.security.PrivilegedAction; 9 | 10 | import static org.apache.logging.log4j.LogManager.getLogger; 11 | 12 | public class IdHelper { 13 | 14 | private static final Logger logger = getLogger(IdHelper.class); 15 | 16 | /** 17 | * Helper method that uses reflection to set the (inaccessible) id field of 18 | * the given {@link PersistentObject}. 19 | * 20 | * @param persistentObject The object with the inaccessible id field 21 | * @param id The id to set 22 | * @throws NoSuchFieldException 23 | * @throws IllegalAccessException 24 | */ 25 | public static final void setIdOnPersistentObject( 26 | PersistentObject persistentObject, Integer id) 27 | throws NoSuchFieldException, IllegalAccessException { 28 | // use reflection to get the inaccessible final field 'id' 29 | Field idField = PersistentObject.class.getDeclaredField("id"); 30 | 31 | AccessController.doPrivileged((PrivilegedAction) () -> { 32 | idField.setAccessible(true); 33 | try { 34 | idField.set(persistentObject, id); 35 | } catch (IllegalAccessException e) { 36 | logger.error("Could not set ID field for persistent object", e); 37 | } 38 | idField.setAccessible(false); 39 | return null; 40 | }); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/hibernate/ShogunPostgresqlDialect.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.hibernate; 2 | 3 | import org.hibernate.spatial.dialect.postgis.PostgisPG9Dialect; 4 | 5 | import java.sql.Types; 6 | 7 | public class ShogunPostgresqlDialect extends PostgisPG9Dialect { 8 | 9 | private static final long serialVersionUID = 9177170273858773475L; 10 | 11 | public ShogunPostgresqlDialect() { 12 | this.registerColumnType(Types.OTHER, "jsonb"); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporterException.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class GeoServerRESTImporterException extends Exception { 8 | 9 | /** 10 | * 11 | */ 12 | private static final long serialVersionUID = 1L; 13 | 14 | /** 15 | * 16 | */ 17 | public GeoServerRESTImporterException() { 18 | } 19 | 20 | /** 21 | * @param message 22 | */ 23 | public GeoServerRESTImporterException(String message) { 24 | super(message); 25 | } 26 | 27 | /** 28 | * @param cause 29 | */ 30 | public GeoServerRESTImporterException(Throwable cause) { 31 | super(cause); 32 | } 33 | 34 | /** 35 | * @param message 36 | * @param cause 37 | */ 38 | public GeoServerRESTImporterException(String message, Throwable cause) { 39 | super(message, cause); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/AbstractRESTEntity.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | /** 6 | * @author Daniel Koch 7 | * @author terrestris GmbH & Co. KG 8 | */ 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public abstract class AbstractRESTEntity { 11 | 12 | /** 13 | * Default constructor. 14 | */ 15 | public AbstractRESTEntity() { 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTAttribute.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class RESTAttribute extends AbstractRESTEntity { 8 | 9 | /** 10 | * 11 | */ 12 | private String name; 13 | 14 | /** 15 | * 16 | */ 17 | private String binding; 18 | 19 | /** 20 | * Default constructor. 21 | */ 22 | public RESTAttribute() { 23 | 24 | } 25 | 26 | /** 27 | * @param name 28 | * @param binding 29 | */ 30 | public RESTAttribute(String name, String binding) { 31 | this.name = name; 32 | this.binding = binding; 33 | } 34 | 35 | /** 36 | * @return the name 37 | */ 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | /** 43 | * @param name the name to set 44 | */ 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | /** 50 | * @return the binding 51 | */ 52 | public String getBinding() { 53 | return binding; 54 | } 55 | 56 | /** 57 | * @param binding the binding to set 58 | */ 59 | public void setBinding(String binding) { 60 | this.binding = binding; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTCoverageStore.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | /** 4 | * terrestris GmbH & Co. KG 5 | * 6 | * @author ahenn 7 | * @date 01.04.2016 8 | */ 9 | public class RESTCoverageStore extends RESTDataStore { 10 | 11 | public RESTCoverageStore() { 12 | super(); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTDataDirectory.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class RESTDataDirectory extends RESTData { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTDataStore.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class RESTDataStore extends AbstractRESTEntity { 8 | 9 | /** 10 | * 11 | */ 12 | private String name; 13 | 14 | /** 15 | * 16 | */ 17 | private String type; 18 | 19 | /** 20 | * Default constructor. 21 | */ 22 | public RESTDataStore() { 23 | 24 | } 25 | 26 | /** 27 | * @param name 28 | * @param type 29 | */ 30 | public RESTDataStore(String name, String type) { 31 | this.name = name; 32 | this.type = type; 33 | } 34 | 35 | /** 36 | * @return the name 37 | */ 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | /** 43 | * @param name the name to set 44 | */ 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | /** 50 | * @return the type 51 | */ 52 | public String getType() { 53 | return type; 54 | } 55 | 56 | /** 57 | * @param type the type to set 58 | */ 59 | public void setType(String type) { 60 | this.type = type; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTImportTaskList.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | import com.fasterxml.jackson.annotation.JsonRootName; 4 | 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * terrestris GmbH & Co. KG 9 | * 10 | * @author ahenn 11 | * @date 15.04.2016 12 | */ 13 | @JsonRootName("tasks") 14 | public class RESTImportTaskList extends ArrayList { 15 | 16 | /** 17 | * 18 | */ 19 | private static final long serialVersionUID = 1L; 20 | 21 | public RESTImportTaskList() { 22 | 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTStore.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | import com.fasterxml.jackson.annotation.JsonRootName; 4 | 5 | /*** 6 | * 7 | * @author Daniel Koch 8 | * @author terrestris GmbH & Co. KG 9 | * 10 | */ 11 | @JsonRootName(value = "dataStore") 12 | public class RESTStore extends AbstractRESTEntity { 13 | 14 | /** 15 | * 16 | */ 17 | private String name; 18 | 19 | /** 20 | * 21 | */ 22 | private String type; 23 | 24 | /** 25 | * Default constructor. 26 | */ 27 | public RESTStore() { 28 | 29 | } 30 | 31 | /** 32 | * @param name 33 | */ 34 | public RESTStore(String name) { 35 | super(); 36 | this.name = name; 37 | } 38 | 39 | /** 40 | * @return the name 41 | */ 42 | public String getName() { 43 | return name; 44 | } 45 | 46 | /** 47 | * @param name the name to set 48 | */ 49 | public void setName(String name) { 50 | this.name = name; 51 | } 52 | 53 | /** 54 | * @return the type 55 | */ 56 | public String getType() { 57 | return type; 58 | } 59 | 60 | /** 61 | * @param type the type to set 62 | */ 63 | public void setType(String type) { 64 | this.type = type; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTStyle.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class RESTStyle extends AbstractRESTEntity { 8 | 9 | /** 10 | * 11 | */ 12 | private String name; 13 | 14 | /** 15 | * 16 | */ 17 | private String href; 18 | 19 | /** 20 | * Default constructor. 21 | */ 22 | public RESTStyle() { 23 | 24 | } 25 | 26 | /** 27 | * @param name 28 | * @param href 29 | */ 30 | public RESTStyle(String name, String href) { 31 | this.name = name; 32 | this.href = href; 33 | } 34 | 35 | /** 36 | * @return the name 37 | */ 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | /** 43 | * @param name the name to set 44 | */ 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | /** 50 | * @return the href 51 | */ 52 | public String getHref() { 53 | return href; 54 | } 55 | 56 | /** 57 | * @param href the href to set 58 | */ 59 | public void setHref(String href) { 60 | this.href = href; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTTarget.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class RESTTarget extends AbstractRESTEntity { 8 | 9 | /** 10 | * 11 | */ 12 | private String href; 13 | 14 | /** 15 | * 16 | */ 17 | private RESTDataStore dataStore; 18 | 19 | /** 20 | * @return the href 21 | */ 22 | public String getHref() { 23 | return href; 24 | } 25 | 26 | /** 27 | * @param href the href to set 28 | */ 29 | public void setHref(String href) { 30 | this.href = href; 31 | } 32 | 33 | /** 34 | * @return the dataStore 35 | */ 36 | public RESTDataStore getDataStore() { 37 | return dataStore; 38 | } 39 | 40 | /** 41 | * @param dataStore the dataStore to set 42 | */ 43 | public void setDataStore(RESTDataStore dataStore) { 44 | this.dataStore = dataStore; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTTargetDataStore.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class RESTTargetDataStore extends AbstractRESTEntity { 8 | 9 | /** 10 | * 11 | */ 12 | private RESTDataStore dataStore; 13 | 14 | /** 15 | * Default constructor. 16 | */ 17 | public RESTTargetDataStore() { 18 | 19 | } 20 | 21 | /** 22 | * @param name 23 | * @param type 24 | */ 25 | public RESTTargetDataStore(String name, String type) { 26 | this.dataStore = new RESTDataStore(name, type); 27 | } 28 | 29 | /** 30 | * @return the dataStore 31 | */ 32 | public RESTDataStore getDataStore() { 33 | return dataStore; 34 | } 35 | 36 | /** 37 | * @param dataStore the dataStore to set 38 | */ 39 | public void setDataStore(RESTDataStore dataStore) { 40 | this.dataStore = dataStore; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTTargetWorkspace.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class RESTTargetWorkspace extends AbstractRESTEntity { 8 | 9 | /** 10 | * 11 | */ 12 | private RESTWorkspace workspace; 13 | 14 | /** 15 | * Default constructor. 16 | */ 17 | public RESTTargetWorkspace() { 18 | 19 | } 20 | 21 | /** 22 | * @param name 23 | */ 24 | public RESTTargetWorkspace(String name) { 25 | this.workspace = new RESTWorkspace(name); 26 | } 27 | 28 | /** 29 | * @return the workspace 30 | */ 31 | public RESTWorkspace getWorkspace() { 32 | return workspace; 33 | } 34 | 35 | /** 36 | * @param workspace the workspace to set 37 | */ 38 | public void setWorkspace(RESTWorkspace workspace) { 39 | this.workspace = workspace; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTWorkspace.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.communication; 2 | 3 | import com.fasterxml.jackson.annotation.JsonRootName; 4 | 5 | /** 6 | * @author Daniel Koch 7 | * @author terrestris GmbH & Co. KG 8 | */ 9 | @JsonRootName(value = "workspace") 10 | public class RESTWorkspace extends AbstractRESTEntity { 11 | 12 | /** 13 | * 14 | */ 15 | private String name; 16 | 17 | /** 18 | * Default constructor. 19 | */ 20 | public RESTWorkspace() { 21 | 22 | } 23 | 24 | /** 25 | * @param name 26 | */ 27 | public RESTWorkspace(String name) { 28 | this.name = name; 29 | } 30 | 31 | /** 32 | * @return the name 33 | */ 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | /** 39 | * @param name the name to set 40 | */ 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/transform/RESTDateFormatTransform.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.transform; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class RESTDateFormatTransform extends RESTTransform { 8 | 9 | /** 10 | * 11 | */ 12 | private String href; 13 | 14 | /** 15 | * 16 | */ 17 | private String field; 18 | 19 | /** 20 | * 21 | */ 22 | private String format; 23 | 24 | /** 25 | * @return the href 26 | */ 27 | public String getHref() { 28 | return href; 29 | } 30 | 31 | /** 32 | * @param href the href to set 33 | */ 34 | public void setHref(String href) { 35 | this.href = href; 36 | } 37 | 38 | /** 39 | * @return the field 40 | */ 41 | public String getField() { 42 | return field; 43 | } 44 | 45 | /** 46 | * @param field the field to set 47 | */ 48 | public void setField(String field) { 49 | this.field = field; 50 | } 51 | 52 | /** 53 | * @return the format 54 | */ 55 | public String getFormat() { 56 | return format; 57 | } 58 | 59 | /** 60 | * @param format the format to set 61 | */ 62 | public void setFormat(String format) { 63 | this.format = format; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/transform/RESTGdalAddoTransform.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.transform; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * terrestris GmbH & Co. KG 7 | * 8 | * @author ahenn 9 | * @date 01.04.2016 10 | *

11 | * Task performing gdaladdo which builds or rebuilds overview images. 12 | * @see GDAL (gdaladdo) documentation 13 | * Requires gdaladdo to be inside the PATH used by the web container running GeoServer. 14 | */ 15 | public class RESTGdalAddoTransform extends RESTTransform { 16 | 17 | public static final String TYPE_NAME = "GdalAddoTransform"; 18 | 19 | private List options; 20 | private List levels; 21 | 22 | /** 23 | * Default constructor; sets type of 24 | * {@link RESTTransform} to "GdalAddoTransform" 25 | */ 26 | public RESTGdalAddoTransform() { 27 | super(TYPE_NAME); 28 | } 29 | 30 | /** 31 | * @return the options 32 | */ 33 | public List getOptions() { 34 | return options; 35 | } 36 | 37 | /** 38 | * @param options the options to set 39 | */ 40 | public void setOptions(List options) { 41 | this.options = options; 42 | } 43 | 44 | /** 45 | * @return the levels 46 | */ 47 | public List getLevels() { 48 | return levels; 49 | } 50 | 51 | /** 52 | * @param levels the levels to set 53 | */ 54 | public void setLevels(List levels) { 55 | this.levels = levels; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/transform/RESTGdalTranslateTransform.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package de.terrestris.shoguncore.importer.transform; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * terrestris GmbH & Co. KG 10 | * 11 | * @author ahenn 12 | * @date 01.04.2016 13 | *

14 | * Importer transform task representing gdal_translate, a tool which converts 15 | * raster data between different formats 16 | * @see GDAL (gdal_translate) documentation 17 | * Requires gdal_translate to be inside the PATH used by the web container running GeoServer. 18 | */ 19 | public class RESTGdalTranslateTransform extends RESTTransform { 20 | 21 | /** 22 | * 23 | */ 24 | public static final String TYPE_NAME = "GdalTranslateTransform"; 25 | 26 | private List options; 27 | 28 | /** 29 | * Default constructor; sets type of 30 | * {@link RESTTransform} to "GdalTranslateTransform" 31 | */ 32 | public RESTGdalTranslateTransform() { 33 | super(TYPE_NAME); 34 | } 35 | 36 | /** 37 | * @return the options 38 | */ 39 | public List getOptions() { 40 | return options; 41 | } 42 | 43 | /** 44 | * @param options the options to set 45 | */ 46 | public void setOptions(List options) { 47 | this.options = options; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/transform/RESTGdalWarpTransform.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.transform; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * terrestris GmbH & Co. KG 7 | * 8 | * @author ahenn 9 | * @date 01.04.2016 10 | *

11 | * Importer transform task representing gdalwarp, an image reprojection and warping utility, 12 | * @see GDAL (gdalwarp) documentation 13 | * Requires gdalwarp to be inside the PATH used by the web container running GeoServer. 14 | */ 15 | public class RESTGdalWarpTransform extends RESTTransform { 16 | 17 | /** 18 | * 19 | */ 20 | public static final String TYPE_NAME = "GdalWarpTransform"; 21 | 22 | private List options; 23 | 24 | /** 25 | * Default constructor; sets type of 26 | * {@link RESTTransform} to "GdalWarpTransform" 27 | */ 28 | public RESTGdalWarpTransform() { 29 | super(TYPE_NAME); 30 | } 31 | 32 | /** 33 | * @return the options 34 | */ 35 | public List getOptions() { 36 | return options; 37 | } 38 | 39 | /** 40 | * @param options the options to set 41 | */ 42 | public void setOptions(List options) { 43 | this.options = options; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/transform/RESTTransform.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.transform; 2 | 3 | import de.terrestris.shoguncore.importer.communication.AbstractRESTEntity; 4 | 5 | /** 6 | * @author Daniel Koch 7 | * @author terrestris GmbH & Co. KG 8 | */ 9 | public class RESTTransform extends AbstractRESTEntity { 10 | 11 | /** 12 | * 13 | */ 14 | private String type; 15 | 16 | /** 17 | * Default constructor 18 | */ 19 | public RESTTransform() { 20 | 21 | } 22 | 23 | /** 24 | * @param type 25 | */ 26 | public RESTTransform(String type) { 27 | this.type = type; 28 | } 29 | 30 | /** 31 | * @return the type 32 | */ 33 | public String getType() { 34 | return type; 35 | } 36 | 37 | /** 38 | * @param type the type to set 39 | */ 40 | public void setType(String type) { 41 | this.type = type; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/transform/RESTTransformChain.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.importer.transform; 2 | 3 | import de.terrestris.shoguncore.importer.communication.AbstractRESTEntity; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author Daniel Koch 9 | * @author terrestris GmbH & Co. KG 10 | */ 11 | public class RESTTransformChain extends AbstractRESTEntity { 12 | 13 | /** 14 | * 15 | */ 16 | private String type; 17 | 18 | /** 19 | * 20 | */ 21 | private List transforms; 22 | 23 | /** 24 | * Default constructor. 25 | */ 26 | public RESTTransformChain() { 27 | 28 | } 29 | 30 | /** 31 | * @return the type 32 | */ 33 | public String getType() { 34 | return type; 35 | } 36 | 37 | /** 38 | * @param type the type to set 39 | */ 40 | public void setType(String type) { 41 | this.type = type; 42 | } 43 | 44 | /** 45 | * @return the transforms 46 | */ 47 | public List getTransforms() { 48 | return transforms; 49 | } 50 | 51 | /** 52 | * @param transforms the transforms to set 53 | */ 54 | public void setTransforms(List transforms) { 55 | this.transforms = transforms; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/model/security/Permission.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.model.security; 2 | 3 | 4 | /** 5 | * @author Nils Bühner 6 | */ 7 | public enum Permission { 8 | ADMIN("ADMIN"), 9 | CREATE("CREATE"), 10 | DELETE("DELETE"), 11 | UPDATE("UPDATE"), 12 | READ("READ"); 13 | 14 | private final String permission; 15 | 16 | /** 17 | * Enum constructor 18 | * 19 | * @param value 20 | */ 21 | Permission(String permission) { 22 | this.permission = permission; 23 | } 24 | 25 | public static Permission fromString(String inputValue) { 26 | if (inputValue != null) { 27 | for (Permission permission : Permission.values()) { 28 | if (inputValue.equalsIgnoreCase(permission.permission)) { 29 | return permission; 30 | } 31 | } 32 | } 33 | return null; 34 | } 35 | 36 | /** 37 | * 38 | */ 39 | @Override 40 | public String toString() { 41 | return permission; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/model/token/PasswordResetToken.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.model.token; 2 | 3 | import de.terrestris.shoguncore.model.User; 4 | 5 | import javax.persistence.Cacheable; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Table; 8 | 9 | /** 10 | * A {@link Token} instance that has a one-to-one relation to a {@link User} 11 | * that wants to reset the password. 12 | * 13 | * @author Daniel Koch 14 | * @author Nils Bühner 15 | */ 16 | @Entity 17 | @Table 18 | @Cacheable 19 | public class PasswordResetToken extends UserToken { 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * Default constructor 28 | */ 29 | public PasswordResetToken() { 30 | } 31 | 32 | /** 33 | * Constructor that uses the default expiration time. 34 | */ 35 | public PasswordResetToken(User user) { 36 | super(user); 37 | } 38 | 39 | /** 40 | * Constructor that uses the passed values 41 | */ 42 | public PasswordResetToken(User user, int expirationInMinutes) { 43 | super(user, expirationInMinutes); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/model/token/RegistrationToken.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.model.token; 2 | 3 | import de.terrestris.shoguncore.model.User; 4 | 5 | import javax.persistence.Cacheable; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Table; 8 | 9 | /** 10 | * A {@link Token} instance that has a one-to-one relation to a {@link User} 11 | * that wants to register. 12 | * 13 | * @author Daniel Koch 14 | * @author Nils Bühner 15 | */ 16 | @Entity 17 | @Table 18 | @Cacheable 19 | public class RegistrationToken extends UserToken { 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * Default constructor 28 | */ 29 | public RegistrationToken() { 30 | } 31 | 32 | /** 33 | * Constructor that uses the default expiration time. 34 | */ 35 | public RegistrationToken(User user) { 36 | super(user); 37 | } 38 | 39 | /** 40 | * Constructor that uses the passed values 41 | */ 42 | public RegistrationToken(User user, int expirationInMinutes) { 43 | super(user, expirationInMinutes); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/paging/PagingResult.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.paging; 2 | 3 | import de.terrestris.shoguncore.model.PersistentObject; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * The Result of a paging request. Contains a list with returned objects and the 9 | * totalCount of available database entries. 10 | * 11 | * @author Nils Bühner 12 | */ 13 | public class PagingResult { 14 | 15 | private List resultList; 16 | 17 | private Number totalCount; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param resultList 23 | * @param number 24 | */ 25 | public PagingResult(List resultList, Number number) { 26 | this.setResultList(resultList); 27 | this.setTotalCount(number); 28 | } 29 | 30 | /** 31 | * @return the resultList 32 | */ 33 | public List getResultList() { 34 | return resultList; 35 | } 36 | 37 | /** 38 | * @param resultList the resultList to set 39 | */ 40 | public void setResultList(List resultList) { 41 | this.resultList = resultList; 42 | } 43 | 44 | /** 45 | * @return the totalCount 46 | */ 47 | public Number getTotalCount() { 48 | return totalCount; 49 | } 50 | 51 | /** 52 | * @param totalCount the totalCount to set 53 | */ 54 | public void setTotalCount(Number totalCount) { 55 | this.totalCount = totalCount; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/ButtonRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.ButtonDao; 4 | import de.terrestris.shoguncore.model.module.Button; 5 | import de.terrestris.shoguncore.service.ButtonService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Nils Bühner 13 | */ 14 | @RestController 15 | @RequestMapping("/buttons") 16 | public class ButtonRestController, S extends ButtonService> 17 | extends AbstractRestController { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public ButtonRestController() { 24 | this((Class) Button.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the controller. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected ButtonRestController(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct service here. 37 | * Otherwise, spring can not decide which service has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("buttonService") 43 | public void setService(S service) { 44 | this.service = service; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/ExtentRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.ExtentDao; 4 | import de.terrestris.shoguncore.model.layer.util.Extent; 5 | import de.terrestris.shoguncore.service.ExtentService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Kai Volland 13 | * @author Nils Bühner 14 | */ 15 | @RestController 16 | @RequestMapping("/extents") 17 | public class ExtentRestController, S extends ExtentService> 18 | extends AbstractRestController { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public ExtentRestController() { 25 | this((Class) Extent.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the controller. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected ExtentRestController(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct service here. 38 | * Otherwise, spring can not decide which service has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("extentService") 44 | public void setService(S service) { 45 | this.service = service; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/ImageFileRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.ImageFileDao; 4 | import de.terrestris.shoguncore.model.ImageFile; 5 | import de.terrestris.shoguncore.service.ImageFileService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Kai Volland 13 | * @author Nils Bühner 14 | */ 15 | @RestController 16 | @RequestMapping("/images") 17 | public class ImageFileRestController, S extends ImageFileService> 18 | extends AbstractRestController { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public ImageFileRestController() { 25 | this((Class) ImageFile.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the controller. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected ImageFileRestController(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct service here. 38 | * Otherwise, spring can not decide which service has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("imageFileService") 44 | public void setService(S service) { 45 | this.service = service; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/LayerRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.LayerDao; 4 | import de.terrestris.shoguncore.model.layer.Layer; 5 | import de.terrestris.shoguncore.service.LayerService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Kai Volland 13 | * @author Nils Bühner 14 | */ 15 | @RestController 16 | @RequestMapping("/layers") 17 | public class LayerRestController, S extends LayerService> 18 | extends AbstractRestController { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public LayerRestController() { 25 | this((Class) Layer.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the controller. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected LayerRestController(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct service here. 38 | * Otherwise, spring can not decide which service has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("layerService") 44 | public void setService(S service) { 45 | this.service = service; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/LayoutRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.LayoutDao; 4 | import de.terrestris.shoguncore.model.layout.Layout; 5 | import de.terrestris.shoguncore.service.LayoutService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Kai Volland 13 | * @author Nils Bühner 14 | */ 15 | @RestController 16 | @RequestMapping("/layouts") 17 | public class LayoutRestController, S extends LayoutService> 18 | extends AbstractRestController { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public LayoutRestController() { 25 | this((Class) Layout.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the controller. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected LayoutRestController(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct service here. 38 | * Otherwise, spring can not decide which service has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("layoutService") 44 | public void setService(S service) { 45 | this.service = service; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/MapConfigRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.MapConfigDao; 4 | import de.terrestris.shoguncore.model.map.MapConfig; 5 | import de.terrestris.shoguncore.service.MapConfigService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Kai Volland 13 | * @author Nils Bühner 14 | */ 15 | @RestController 16 | @RequestMapping("/mapconfigs") 17 | public class MapConfigRestController, S extends MapConfigService> 18 | extends AbstractRestController { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public MapConfigRestController() { 25 | this((Class) MapConfig.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the controller. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected MapConfigRestController(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct service here. 38 | * Otherwise, spring can not decide which service has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("mapConfigService") 44 | public void setService(S service) { 45 | this.service = service; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/MapControlRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.MapControlDao; 4 | import de.terrestris.shoguncore.model.map.MapControl; 5 | import de.terrestris.shoguncore.service.MapControlService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Kai Volland 13 | * @author Nils Bühner 14 | */ 15 | @RestController 16 | @RequestMapping("/mapcontrols") 17 | public class MapControlRestController, S extends MapControlService> 18 | extends AbstractRestController { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public MapControlRestController() { 25 | this((Class) MapControl.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the controller. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected MapControlRestController(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct service here. 38 | * Otherwise, spring can not decide which service has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("mapControlService") 44 | public void setService(S service) { 45 | this.service = service; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/ModuleRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.ModuleDao; 4 | import de.terrestris.shoguncore.model.module.Module; 5 | import de.terrestris.shoguncore.service.ModuleService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Kai Volland 13 | * @author Nils Bühner 14 | */ 15 | @RestController 16 | @RequestMapping("/modules") 17 | public class ModuleRestController, S extends ModuleService> 18 | extends AbstractRestController { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public ModuleRestController() { 25 | this((Class) Module.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the controller. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected ModuleRestController(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct service here. 38 | * Otherwise, spring can not decide which service has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("moduleService") 44 | public void setService(S service) { 45 | this.service = service; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/RoleRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.RoleDao; 4 | import de.terrestris.shoguncore.model.Role; 5 | import de.terrestris.shoguncore.service.RoleService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Andre Henn 13 | */ 14 | @RestController 15 | @RequestMapping("/roles") 16 | public class RoleRestController, S extends RoleService> 17 | extends AbstractRestController { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public RoleRestController() { 24 | this((Class) Role.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the controller. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected RoleRestController(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct service here. 37 | * Otherwise, spring can not decide which service has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("roleService") 43 | public void setService(S service) { 44 | this.service = service; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/TileGridRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.TileGridDao; 4 | import de.terrestris.shoguncore.model.layer.util.TileGrid; 5 | import de.terrestris.shoguncore.service.TileGridService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Kai Volland 13 | * @author Nils Bühner 14 | */ 15 | @RestController 16 | @RequestMapping("/tilegrids") 17 | public class TileGridRestController, S extends TileGridService> 18 | extends AbstractRestController { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public TileGridRestController() { 25 | this((Class) TileGrid.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the controller. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected TileGridRestController(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct service here. 38 | * Otherwise, spring can not decide which service has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("tileGridService") 44 | public void setService(S service) { 45 | this.service = service; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/TreeNodeRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.TreeNodeDao; 4 | import de.terrestris.shoguncore.model.tree.TreeNode; 5 | import de.terrestris.shoguncore.service.TreeNodeService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Kai Volland 13 | * @author Nils Bühner 14 | */ 15 | @RestController 16 | @RequestMapping("/treenodes") 17 | public class TreeNodeRestController, S extends TreeNodeService> 18 | extends AbstractRestController { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public TreeNodeRestController() { 25 | this((Class) TreeNode.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the controller. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected TreeNodeRestController(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct service here. 38 | * Otherwise, spring can not decide which service has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("treeNodeService") 44 | public void setService(S service) { 45 | this.service = service; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/rest/WpsPluginRestController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.rest; 2 | 3 | import de.terrestris.shoguncore.dao.WpsPluginDao; 4 | import de.terrestris.shoguncore.model.wps.WpsPlugin; 5 | import de.terrestris.shoguncore.service.WpsPluginService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @author Nils Bühner 13 | */ 14 | @RestController 15 | @RequestMapping("/wpsplugins") 16 | public class WpsPluginRestController, S extends WpsPluginService> 17 | extends PluginRestController { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public WpsPluginRestController() { 24 | this((Class) WpsPlugin.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the controller. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected WpsPluginRestController(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct service here. 37 | * Otherwise, spring can not decide which service has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("wpsPluginService") 43 | public void setService(S service) { 44 | this.service = service; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/security/access/entity/AlwaysAllowReadPermissionEvaluator.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.security.access.entity; 2 | 3 | import de.terrestris.shoguncore.model.PersistentObject; 4 | import de.terrestris.shoguncore.model.User; 5 | import de.terrestris.shoguncore.model.security.Permission; 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | public class AlwaysAllowReadPermissionEvaluator extends 11 | PersistentObjectPermissionEvaluator { 12 | 13 | /** 14 | * Default constructor 15 | */ 16 | @SuppressWarnings("unchecked") 17 | public AlwaysAllowReadPermissionEvaluator() { 18 | this((Class) PersistentObject.class); 19 | } 20 | 21 | /** 22 | * Constructor for subclasses 23 | * 24 | * @param entityClass 25 | */ 26 | protected AlwaysAllowReadPermissionEvaluator(Class entityClass) { 27 | super(entityClass); 28 | } 29 | 30 | /** 31 | * Grants READ permission on the user object of the currently logged in 32 | * user. Uses default implementation otherwise. 33 | */ 34 | @Override 35 | public boolean hasPermission(User user, E entity, Permission permission) { 36 | 37 | // always grant READ access ("unsecured" object) 38 | if (permission.equals(Permission.READ)) { 39 | logger.trace("Granting READ access on " + entity.getClass().getSimpleName() + " with ID " + entity.getId()); 40 | return true; 41 | } 42 | 43 | // call parent implementation 44 | return super.hasPermission(user, entity, permission); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/security/access/entity/PermissionCollectionPermissionEvaluator.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.security.access.entity; 2 | 3 | import de.terrestris.shoguncore.model.User; 4 | import de.terrestris.shoguncore.model.security.Permission; 5 | import de.terrestris.shoguncore.model.security.PermissionCollection; 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | public class PermissionCollectionPermissionEvaluator extends 11 | PersistentObjectPermissionEvaluator { 12 | 13 | /** 14 | * Default constructor 15 | */ 16 | @SuppressWarnings("unchecked") 17 | public PermissionCollectionPermissionEvaluator() { 18 | this((Class) PermissionCollection.class); 19 | } 20 | 21 | /** 22 | * Constructor for subclasses 23 | * 24 | * @param entityClass 25 | */ 26 | protected PermissionCollectionPermissionEvaluator(Class entityClass) { 27 | super(entityClass); 28 | } 29 | 30 | /** 31 | * Always grants every permission on permission collections. 32 | */ 33 | @Override 34 | public boolean hasPermission(User user, E permissionCollection, Permission permission) { 35 | 36 | // it is necessary to grant every permission. 37 | // otherwise permission collections could not be created or updated. 38 | return true; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/security/access/entity/UserGroupPermissionEvaluator.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.security.access.entity; 2 | 3 | import de.terrestris.shoguncore.model.User; 4 | import de.terrestris.shoguncore.model.UserGroup; 5 | import de.terrestris.shoguncore.model.security.Permission; 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | public class UserGroupPermissionEvaluator extends 11 | PersistentObjectPermissionEvaluator { 12 | 13 | /** 14 | * Default constructor 15 | */ 16 | @SuppressWarnings("unchecked") 17 | public UserGroupPermissionEvaluator() { 18 | this((Class) UserGroup.class); 19 | } 20 | 21 | /** 22 | * Constructor for subclasses 23 | * 24 | * @param entityClass 25 | */ 26 | protected UserGroupPermissionEvaluator(Class entityClass) { 27 | super(entityClass); 28 | } 29 | 30 | /** 31 | * Grants READ permission on groups where the user is a member. 32 | * Uses default implementation otherwise. 33 | */ 34 | @Override 35 | public boolean hasPermission(User user, E userGroup, Permission permission) { 36 | 37 | // always grant READ access to groups in which the user itself is a member 38 | if (user != null && permission.equals(Permission.READ) 39 | && userGroup.getMembers().contains(user)) { 40 | logger.trace("Granting READ access on group where the user is member."); 41 | return true; 42 | } 43 | 44 | // call parent implementation 45 | return super.hasPermission(user, userGroup, permission); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/security/access/entity/UserPermissionEvaluator.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.security.access.entity; 2 | 3 | import de.terrestris.shoguncore.model.User; 4 | import de.terrestris.shoguncore.model.security.Permission; 5 | 6 | /** 7 | * @author Nils Bühner 8 | */ 9 | public class UserPermissionEvaluator extends 10 | PersistentObjectPermissionEvaluator { 11 | 12 | /** 13 | * Default constructor 14 | */ 15 | @SuppressWarnings("unchecked") 16 | public UserPermissionEvaluator() { 17 | this((Class) User.class); 18 | } 19 | 20 | /** 21 | * Constructor for subclasses 22 | * 23 | * @param entityClass 24 | */ 25 | protected UserPermissionEvaluator(Class entityClass) { 26 | super(entityClass); 27 | } 28 | 29 | /** 30 | * Grants READ permission on the user object of the currently logged in 31 | * user. Uses default implementation otherwise. 32 | */ 33 | @Override 34 | public boolean hasPermission(User user, E entity, Permission permission) { 35 | 36 | // always grant READ access to own user object (of the logged in user) 37 | if (user != null && user.equals(entity) 38 | && permission.equals(Permission.READ)) { 39 | logger.trace("Granting READ access on own user object"); 40 | return true; 41 | } 42 | 43 | // call parent implementation 44 | return super.hasPermission(user, entity, permission); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/ApplicationService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.ApplicationDao; 4 | import de.terrestris.shoguncore.model.Application; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link Application} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("applicationService") 16 | public class ApplicationService> 17 | extends PermissionAwareCrudService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public ApplicationService() { 24 | this((Class) Application.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected ApplicationService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("applicationDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/ButtonService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.ButtonDao; 4 | import de.terrestris.shoguncore.model.module.Button; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link Button} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("buttonService") 16 | public class ButtonService> extends 17 | PermissionAwareCrudService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public ButtonService() { 24 | this((Class) Button.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected ButtonService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("buttonDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/EndpointDocService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.web.EndpointDocController; 4 | import org.springframework.security.access.prepost.PreAuthorize; 5 | import org.springframework.stereotype.Service; 6 | import org.springframework.web.servlet.mvc.method.RequestMappingInfo; 7 | import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; 8 | 9 | import java.util.Set; 10 | 11 | /** 12 | * Service class for the {@link EndpointDocController}. 13 | * 14 | * @author Christian Mayer 15 | */ 16 | @Service("endpointDocService") 17 | public class EndpointDocService { 18 | 19 | /** 20 | * Returns all RequestMappingInfo instances from type and 21 | * method-level @RequestMapping annotations in @Controller classes. 22 | * 23 | * @param requestMappingHandlerMapping The RequestMappingInfo collection of Spring 24 | * @return A set of RequestMappingInfo 25 | */ 26 | @PreAuthorize("hasRole(@configHolder.getSuperAdminRoleName())") 27 | public Set getEndpoints(RequestMappingHandlerMapping requestMappingHandlerMapping) { 28 | return requestMappingHandlerMapping.getHandlerMethods().keySet(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/ExtentService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.ExtentDao; 4 | import de.terrestris.shoguncore.model.layer.util.Extent; 5 | import de.terrestris.shoguncore.model.module.Module; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * Service class for the {@link Module} model. 12 | * 13 | * @author Nils Bühner 14 | * @see AbstractCrudService 15 | */ 16 | @Service("extentService") 17 | public class ExtentService> extends 18 | PermissionAwareCrudService { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public ExtentService() { 25 | this((Class) Extent.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the service. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected ExtentService(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct dao here. 38 | * Otherwise, spring can not decide which dao has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("extentDao") 44 | public void setDao(D dao) { 45 | this.dao = dao; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/LayerAppearanceService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.LayerAppearanceDao; 4 | import de.terrestris.shoguncore.model.layer.appearance.LayerAppearance; 5 | import de.terrestris.shoguncore.model.module.Module; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * Service class for the {@link Module} model. 12 | * 13 | * @author Nils Bühner 14 | * @see AbstractCrudService 15 | */ 16 | @Service("layerAppearanceService") 17 | public class LayerAppearanceService> extends 18 | PermissionAwareCrudService { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public LayerAppearanceService() { 25 | this((Class) LayerAppearance.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the service. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected LayerAppearanceService(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct dao here. 38 | * Otherwise, spring can not decide which dao has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("layerAppearanceDao") 44 | public void setDao(D dao) { 45 | this.dao = dao; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/LayerDataSourceService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.LayerDataSourceDao; 4 | import de.terrestris.shoguncore.model.layer.source.LayerDataSource; 5 | import de.terrestris.shoguncore.model.module.Module; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * Service class for the {@link Module} model. 12 | * 13 | * @author Nils Bühner 14 | * @see AbstractCrudService 15 | */ 16 | @Service("layerDataSourceService") 17 | public class LayerDataSourceService> extends 18 | PermissionAwareCrudService { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public LayerDataSourceService() { 25 | this((Class) LayerDataSource.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the service. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected LayerDataSourceService(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct dao here. 38 | * Otherwise, spring can not decide which dao has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("layerDataSourceDao") 44 | public void setDao(D dao) { 45 | this.dao = dao; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/LayoutService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.LayoutDao; 4 | import de.terrestris.shoguncore.model.layout.Layout; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link Layout} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("layoutService") 16 | public class LayoutService> extends 17 | PermissionAwareCrudService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public LayoutService() { 24 | this((Class) Layout.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected LayoutService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("layoutDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/MapConfigService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.MapConfigDao; 4 | import de.terrestris.shoguncore.model.map.MapConfig; 5 | import de.terrestris.shoguncore.model.module.Module; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * Service class for the {@link Module} model. 12 | * 13 | * @author Nils Bühner 14 | * @see AbstractCrudService 15 | */ 16 | @Service("mapConfigService") 17 | public class MapConfigService> extends 18 | PermissionAwareCrudService { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public MapConfigService() { 25 | this((Class) MapConfig.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the service. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected MapConfigService(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct dao here. 38 | * Otherwise, spring can not decide which dao has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("mapConfigDao") 44 | public void setDao(D dao) { 45 | this.dao = dao; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/MapControlService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.MapControlDao; 4 | import de.terrestris.shoguncore.model.map.MapControl; 5 | import de.terrestris.shoguncore.model.module.Module; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * Service class for the {@link Module} model. 12 | * 13 | * @author Nils Bühner 14 | * @see AbstractCrudService 15 | */ 16 | @Service("mapControlService") 17 | public class MapControlService> extends 18 | PermissionAwareCrudService { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public MapControlService() { 25 | this((Class) MapControl.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the service. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected MapControlService(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct dao here. 38 | * Otherwise, spring can not decide which dao has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("mapControlDao") 44 | public void setDao(D dao) { 45 | this.dao = dao; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/ModuleService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.ModuleDao; 4 | import de.terrestris.shoguncore.model.module.Module; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link Module} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("moduleService") 16 | public class ModuleService> extends 17 | PermissionAwareCrudService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public ModuleService() { 24 | this((Class) Module.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected ModuleService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("moduleDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/PermissionCollectionService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.PermissionCollectionDao; 4 | import de.terrestris.shoguncore.model.security.PermissionCollection; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link PermissionCollection} model. 11 | * 12 | * @author Nils Bühner 13 | * @author Johannes Weskamm 14 | * @see AbstractCrudService 15 | */ 16 | @Service("permissionCollectionService") 17 | public class PermissionCollectionService> extends 18 | AbstractCrudService { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public PermissionCollectionService() { 25 | this((Class) PermissionCollection.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the service. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected PermissionCollectionService(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct dao here. 38 | * Otherwise, spring can not decide which dao has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("permissionCollectionDao") 44 | public void setDao(D dao) { 45 | this.dao = dao; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/PersonService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.PersonDao; 4 | import de.terrestris.shoguncore.model.Person; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link Person} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("personService") 16 | public class PersonService> extends 17 | PermissionAwareCrudService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public PersonService() { 24 | this((Class) Person.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected PersonService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("personDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/TileGridService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.TileGridDao; 4 | import de.terrestris.shoguncore.model.layer.util.TileGrid; 5 | import de.terrestris.shoguncore.model.module.Module; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * Service class for the {@link Module} model. 12 | * 13 | * @author Nils Bühner 14 | * @see AbstractCrudService 15 | */ 16 | @Service("tileGridService") 17 | public class TileGridService> extends 18 | PermissionAwareCrudService { 19 | 20 | /** 21 | * Default constructor, which calls the type-constructor 22 | */ 23 | @SuppressWarnings("unchecked") 24 | public TileGridService() { 25 | this((Class) TileGrid.class); 26 | } 27 | 28 | /** 29 | * Constructor that sets the concrete entity class for the service. 30 | * Subclasses MUST call this constructor. 31 | */ 32 | protected TileGridService(Class entityClass) { 33 | super(entityClass); 34 | } 35 | 36 | /** 37 | * We have to use {@link Qualifier} to define the correct dao here. 38 | * Otherwise, spring can not decide which dao has to be autowired here 39 | * as there are multiple candidates. 40 | */ 41 | @Override 42 | @Autowired 43 | @Qualifier("tileGridDao") 44 | public void setDao(D dao) { 45 | this.dao = dao; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/TreeFolderService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.TreeFolderDao; 4 | import de.terrestris.shoguncore.model.tree.TreeFolder; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link TreeFolder} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("treeFolderService") 16 | public class TreeFolderService> extends 17 | PermissionAwareCrudService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public TreeFolderService() { 24 | this((Class) TreeFolder.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected TreeFolderService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("treeFolderDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/WpsParameterService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.WpsParameterDao; 4 | import de.terrestris.shoguncore.model.wps.WpsParameter; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link WpsParameter} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("wpsParameterService") 16 | public class WpsParameterService> extends 17 | PermissionAwareCrudService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public WpsParameterService() { 24 | this((Class) WpsParameter.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected WpsParameterService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("wpsParameterDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/WpsPluginService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.WpsPluginDao; 4 | import de.terrestris.shoguncore.model.wps.WpsPlugin; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link WpsPlugin} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("wpsPluginService") 16 | public class WpsPluginService> extends 17 | PluginService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public WpsPluginService() { 24 | this((Class) WpsPlugin.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected WpsPluginService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("wpsPluginDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/WpsPrimitiveService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.WpsPrimitiveDao; 4 | import de.terrestris.shoguncore.model.wps.WpsPrimitive; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link WpsPrimitive} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("wpsPrimitiveService") 16 | public class WpsPrimitiveService> extends 17 | WpsParameterService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public WpsPrimitiveService() { 24 | this((Class) WpsPrimitive.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected WpsPrimitiveService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("wpsPrimitiveDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/WpsReferenceService.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.WpsReferenceDao; 4 | import de.terrestris.shoguncore.model.wps.WpsReference; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Service class for the {@link WpsReference} model. 11 | * 12 | * @author Nils Bühner 13 | * @see AbstractCrudService 14 | */ 15 | @Service("wpsReferenceService") 16 | public class WpsReferenceService> extends 17 | WpsParameterService { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public WpsReferenceService() { 24 | this((Class) WpsReference.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the service. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected WpsReferenceService(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct dao here. 37 | * Otherwise, spring can not decide which dao has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("wpsReferenceDao") 43 | public void setDao(D dao) { 44 | this.dao = dao; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/application/ShogunCoreContextUtil.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.application; 2 | 3 | import org.apache.http.client.utils.URIBuilder; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import java.net.URI; 7 | import java.net.URISyntaxException; 8 | 9 | /** 10 | * @author Daniel Koch 11 | */ 12 | public class ShogunCoreContextUtil { 13 | 14 | /** 15 | * Returns the full webapplication URI from a given request. 16 | *

17 | * Example: 18 | *

19 | * The following GET-request: 20 | * http://localhost:8080/mapmavin/user/resetPassword.action 21 | * will result in 22 | * http://localhost:8080/mapmavin/ 23 | * 24 | * @param request 25 | * @return 26 | * @throws URISyntaxException 27 | */ 28 | public static final URI getApplicationURIFromRequest(HttpServletRequest request) 29 | throws URISyntaxException { 30 | 31 | URI appURI = null; 32 | 33 | String scheme = request.getScheme(); 34 | String host = request.getServerName(); 35 | int port = request.getServerPort(); 36 | String path = request.getContextPath(); 37 | 38 | appURI = new URIBuilder() 39 | .setScheme(scheme) 40 | .setHost(host) 41 | .setPort(port) 42 | .setPath(path) 43 | .build(); 44 | 45 | return appURI; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/bean/NullAwareBeanUtilsBean.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.bean; 2 | 3 | import org.apache.commons.beanutils.BeanUtilsBean; 4 | 5 | import java.lang.reflect.InvocationTargetException; 6 | 7 | /** 8 | * Credits go to http://stackoverflow.com/a/3521314 9 | * 10 | * @author Nils Bühner 11 | */ 12 | public class NullAwareBeanUtilsBean extends BeanUtilsBean { 13 | 14 | @Override 15 | public void copyProperty(Object dest, String name, Object value) 16 | throws IllegalAccessException, InvocationTargetException { 17 | if (value == null) { 18 | return; 19 | } 20 | super.copyProperty(dest, name, value); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/config/ConfigHolder.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.config; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * Helper component class to make property values available for use in 8 | * annotations. Credits go to http://stackoverflow.com/a/18207602 9 | * 10 | * @author Nils Bühner 11 | */ 12 | @Component("configHolder") 13 | public class ConfigHolder { 14 | 15 | /** 16 | * The name of the (super) admin role. If the property configured in the 17 | * {@link Value} annotation is not present, the empty string "" will be used 18 | * as a fallback. 19 | */ 20 | @Value("${role.superAdminRoleName:}") 21 | private String superAdminRoleName; 22 | 23 | /** 24 | * The name of the default user role. If the property configured in the 25 | * {@link Value} annotation is not present, the empty string "" will be used 26 | * as a fallback. 27 | */ 28 | @Value("${role.defaultUserRoleName:}") 29 | private String defaultUserRoleName; 30 | 31 | /** 32 | * @return the superAdminRoleName 33 | */ 34 | public String getSuperAdminRoleName() { 35 | return superAdminRoleName; 36 | } 37 | 38 | /** 39 | * @return the defaultUserRoleName 40 | */ 41 | public String getDefaultUserRoleName() { 42 | return defaultUserRoleName; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/dialect/ShogunCoreOracleDialect.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.dialect; 2 | 3 | import org.hibernate.dialect.Dialect; 4 | import org.hibernate.dialect.Oracle12cDialect; 5 | 6 | import java.sql.Types; 7 | 8 | /** 9 | * SQL {@link Dialect} extending {@link Oracle12cDialect} to register 10 | * column mapping for LOB datatypes used in SHOGun-Core (e.g. file content 11 | * in {@link de.terrestris.shoguncore.model.File}) 12 | * 13 | * @author Andre Henn 14 | * @author terrestris GmbH & co. KG 15 | */ 16 | public class ShogunCoreOracleDialect extends Oracle12cDialect { 17 | 18 | /** 19 | * 20 | */ 21 | public ShogunCoreOracleDialect() { 22 | super(); 23 | } 24 | 25 | /** 26 | * 27 | */ 28 | @Override 29 | protected void registerLargeObjectTypeMappings() { 30 | super.registerLargeObjectTypeMappings(); 31 | 32 | registerColumnType(Types.VARBINARY, "blob"); 33 | registerColumnType(Types.LONGVARCHAR, "clob"); 34 | registerColumnType(Types.LONGVARBINARY, "long raw"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/CachedServletInputStream.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import javax.servlet.ReadListener; 4 | import javax.servlet.ServletInputStream; 5 | import java.io.ByteArrayInputStream; 6 | import java.io.ByteArrayOutputStream; 7 | import java.io.IOException; 8 | 9 | /** 10 | * An inputstream which reads the cached request body and has mutable 11 | * request URI and params. 12 | * 13 | * @author Daniel Koch 14 | * @author terrestris GmbH & Co. KG 15 | * @see http://stackoverflow.com/questions/10210645/http-servlet-request-lose-params-from-post-body-after-read-it-once 16 | */ 17 | public class CachedServletInputStream extends ServletInputStream { 18 | 19 | /** 20 | * 21 | */ 22 | private ByteArrayInputStream input; 23 | 24 | /** 25 | * Create a new input stream from the cached request body 26 | */ 27 | public CachedServletInputStream(ByteArrayOutputStream cachedBytes) { 28 | input = new ByteArrayInputStream(cachedBytes.toByteArray()); 29 | } 30 | 31 | /** 32 | * 33 | */ 34 | @Override 35 | public int read() throws IOException { 36 | return input.read(); 37 | } 38 | 39 | /** 40 | * 41 | */ 42 | @Override 43 | public boolean isFinished() { 44 | return false; 45 | } 46 | 47 | /** 48 | * 49 | */ 50 | @Override 51 | public boolean isReady() { 52 | return false; 53 | } 54 | 55 | /** 56 | * 57 | */ 58 | @Override 59 | public void setReadListener(ReadListener readListener) { 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/InterceptorException.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | /** 4 | * @author Daniel Koch 5 | * @author terrestris GmbH & Co. KG 6 | */ 7 | public class InterceptorException extends Exception { 8 | 9 | /** 10 | * 11 | */ 12 | private static final long serialVersionUID = 1L; 13 | 14 | /** 15 | * 16 | */ 17 | public InterceptorException() { 18 | } 19 | 20 | /** 21 | * @param message 22 | */ 23 | public InterceptorException(String message) { 24 | super(message); 25 | } 26 | 27 | /** 28 | * @param cause 29 | */ 30 | public InterceptorException(Throwable cause) { 31 | super(cause); 32 | } 33 | 34 | /** 35 | * @param message 36 | * @param cause 37 | */ 38 | public InterceptorException(String message, Throwable cause) { 39 | super(message, cause); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WcsRequestInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public interface WcsRequestInterceptorInterface { 7 | 8 | MutableHttpServletRequest interceptGetCapabilities(MutableHttpServletRequest request); 9 | 10 | MutableHttpServletRequest interceptDescribeCoverage(MutableHttpServletRequest request); 11 | 12 | MutableHttpServletRequest interceptGetCoverage(MutableHttpServletRequest request); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WcsResponseInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import de.terrestris.shoguncore.util.model.Response; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public interface WcsResponseInterceptorInterface { 8 | 9 | Response interceptGetCapabilities(MutableHttpServletRequest request, Response response); 10 | 11 | Response interceptDescribeCoverage(MutableHttpServletRequest request, Response response); 12 | 13 | Response interceptGetCoverage(MutableHttpServletRequest request, Response response); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WfsRequestInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public interface WfsRequestInterceptorInterface { 7 | 8 | MutableHttpServletRequest interceptGetCapabilities(MutableHttpServletRequest request); 9 | 10 | MutableHttpServletRequest interceptDescribeFeatureType(MutableHttpServletRequest request); 11 | 12 | MutableHttpServletRequest interceptGetFeature(MutableHttpServletRequest request); 13 | 14 | MutableHttpServletRequest interceptLockFeature(MutableHttpServletRequest request); 15 | 16 | MutableHttpServletRequest interceptTransaction(MutableHttpServletRequest request); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WfsResponseInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import de.terrestris.shoguncore.util.model.Response; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public interface WfsResponseInterceptorInterface { 8 | 9 | Response interceptGetCapabilities(MutableHttpServletRequest request, Response response); 10 | 11 | Response interceptDescribeFeatureType(MutableHttpServletRequest request, Response response); 12 | 13 | Response interceptGetFeature(MutableHttpServletRequest request, Response response); 14 | 15 | Response interceptLockFeature(MutableHttpServletRequest request, Response response); 16 | 17 | Response interceptTransaction(MutableHttpServletRequest request, Response response); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WmsRequestInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public interface WmsRequestInterceptorInterface { 7 | 8 | MutableHttpServletRequest interceptGetMap(MutableHttpServletRequest request); 9 | 10 | MutableHttpServletRequest interceptGetCapabilities(MutableHttpServletRequest request); 11 | 12 | MutableHttpServletRequest interceptGetFeatureInfo(MutableHttpServletRequest request); 13 | 14 | MutableHttpServletRequest interceptDescribeLayer(MutableHttpServletRequest request); 15 | 16 | MutableHttpServletRequest interceptGetLegendGraphic(MutableHttpServletRequest request); 17 | 18 | MutableHttpServletRequest interceptGetStyles(MutableHttpServletRequest request); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WmsResponseInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import de.terrestris.shoguncore.util.model.Response; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public interface WmsResponseInterceptorInterface { 8 | 9 | Response interceptGetMap(MutableHttpServletRequest request, Response response); 10 | 11 | Response interceptGetCapabilities(MutableHttpServletRequest request, Response response); 12 | 13 | Response interceptGetFeatureInfo(MutableHttpServletRequest request, Response response); 14 | 15 | Response interceptDescribeLayer(MutableHttpServletRequest request, Response response); 16 | 17 | Response interceptGetLegendGraphic(MutableHttpServletRequest request, Response response); 18 | 19 | Response interceptGetStyles(MutableHttpServletRequest request, Response response); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WmtsRequestInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public interface WmtsRequestInterceptorInterface { 7 | 8 | MutableHttpServletRequest interceptGetTile(MutableHttpServletRequest request); 9 | 10 | MutableHttpServletRequest interceptGetCapabilities(MutableHttpServletRequest request); 11 | 12 | MutableHttpServletRequest interceptGetFeatureInfo(MutableHttpServletRequest request); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WmtsResponseInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import de.terrestris.shoguncore.util.model.Response; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public interface WmtsResponseInterceptorInterface { 8 | 9 | Response interceptGetTile(MutableHttpServletRequest request, Response response); 10 | 11 | Response interceptGetCapabilities(MutableHttpServletRequest request, Response response); 12 | 13 | Response interceptGetFeatureInfo(MutableHttpServletRequest request, Response response); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WpsRequestInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public interface WpsRequestInterceptorInterface { 7 | 8 | MutableHttpServletRequest interceptGetCapabilities(MutableHttpServletRequest request); 9 | 10 | MutableHttpServletRequest interceptDescribeProcess(MutableHttpServletRequest request); 11 | 12 | MutableHttpServletRequest interceptExecute(MutableHttpServletRequest request); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/WpsResponseInterceptorInterface.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import de.terrestris.shoguncore.util.model.Response; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public interface WpsResponseInterceptorInterface { 8 | 9 | Response interceptGetCapabilities(MutableHttpServletRequest request, Response response); 10 | 11 | Response interceptDescribeProcess(MutableHttpServletRequest request, Response response); 12 | 13 | Response interceptExecute(MutableHttpServletRequest request, Response response); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/secure/BaseInterceptor.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor.secure; 2 | 3 | import de.terrestris.shoguncore.util.application.ShogunCoreContextUtil; 4 | import de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest; 5 | 6 | import java.net.URI; 7 | import java.net.URISyntaxException; 8 | 9 | /** 10 | *

BaseInterceptor class.

11 | */ 12 | public class BaseInterceptor { 13 | 14 | /** 15 | * 16 | */ 17 | private URI appUri = null; 18 | 19 | /** 20 | *

forbidRequest.

21 | * 22 | * @param request a {@link de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest} object. 23 | * @return a {@link de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest} object. 24 | */ 25 | protected MutableHttpServletRequest forbidRequest(MutableHttpServletRequest request) { 26 | this.setAppUriFromRequest(request); 27 | String redirectUri = appUri == null ? "" : appUri.toString(); 28 | request.setRequestURI(redirectUri + "/response/forbidden.action"); 29 | return request; 30 | } 31 | 32 | /** 33 | *

setAppUriFromRequest.

34 | * 35 | * @param request a {@link de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest} object. 36 | */ 37 | protected void setAppUriFromRequest(MutableHttpServletRequest request) { 38 | if (appUri == null) { 39 | try { 40 | appUri = ShogunCoreContextUtil.getApplicationURIFromRequest(request); 41 | } catch (URISyntaxException e) { 42 | // pass 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/json/ShogunCoreJsonObjectMapper.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.json; 2 | 3 | import com.bedatadriven.jackson.datatype.jts.JtsModule; 4 | import com.fasterxml.jackson.databind.ObjectMapper; 5 | import com.fasterxml.jackson.databind.SerializationFeature; 6 | import com.fasterxml.jackson.databind.util.StdDateFormat; 7 | import com.fasterxml.jackson.datatype.joda.JodaModule; 8 | 9 | import java.util.TimeZone; 10 | 11 | /** 12 | * Customized JSON/Jackson ObjectMapper attending the needs of SHOGun-Core. 13 | *

14 | * This class will load the JodaModule for Jackson to support joda time types 15 | * and sets the date format to ISO8601, i.e. dates will be serialized in 16 | * ISO8601. 17 | * 18 | * @author Nils Bühner 19 | */ 20 | public class ShogunCoreJsonObjectMapper extends ObjectMapper { 21 | 22 | /** 23 | * 24 | */ 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * Constructor 29 | */ 30 | public ShogunCoreJsonObjectMapper() { 31 | super(); 32 | 33 | // register the joda module to support the joda time types, which are 34 | // used in shogun 35 | this.registerModule(new JodaModule()); 36 | 37 | // register JTS geometry types 38 | this.registerModule(new JtsModule()); 39 | 40 | // StdDateFormat is ISO8601 since jackson 2.9 41 | configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); 42 | setDateFormat(new StdDateFormat()); 43 | setTimeZone(TimeZone.getDefault()); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/web/LayerController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package de.terrestris.shoguncore.web; 5 | 6 | import de.terrestris.shoguncore.dao.LayerDao; 7 | import de.terrestris.shoguncore.model.layer.Layer; 8 | import de.terrestris.shoguncore.service.LayerService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Qualifier; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | /** 15 | * @author Johannes Weskamm 16 | * @author Kai Volland 17 | * @author Nils Bühner 18 | */ 19 | @Controller 20 | @RequestMapping("/layer") 21 | public abstract class LayerController, S extends LayerService> 22 | extends AbstractWebController { 23 | 24 | /** 25 | * Default constructor, which calls the type-constructor 26 | */ 27 | @SuppressWarnings("unchecked") 28 | public LayerController() { 29 | this((Class) Layer.class); 30 | } 31 | 32 | /** 33 | * Constructor that sets the concrete entity class for the controller. 34 | * Subclasses MUST call this constructor. 35 | */ 36 | protected LayerController(Class entityClass) { 37 | super(entityClass); 38 | } 39 | 40 | /** 41 | * We have to use {@link Qualifier} to define the correct service here. 42 | * Otherwise, spring can not decide which service has to be autowired here 43 | * as there are multiple candidates. 44 | */ 45 | @Override 46 | @Autowired 47 | @Qualifier("layerService") 48 | public void setService(S service) { 49 | this.service = service; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/web/ModuleController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.web; 2 | 3 | import de.terrestris.shoguncore.dao.ModuleDao; 4 | import de.terrestris.shoguncore.model.module.Module; 5 | import de.terrestris.shoguncore.service.ModuleService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | /** 12 | * @author Nils Bühner 13 | */ 14 | @Controller 15 | @RequestMapping("/module") 16 | public class ModuleController, S extends ModuleService> 17 | extends AbstractWebController { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public ModuleController() { 24 | this((Class) Module.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the controller. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected ModuleController(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct service here. 37 | * Otherwise, spring can not decide which service has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("moduleService") 43 | public void setService(S service) { 44 | this.service = service; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/web/TreeNodeController.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.web; 2 | 3 | import de.terrestris.shoguncore.dao.TreeNodeDao; 4 | import de.terrestris.shoguncore.model.tree.TreeNode; 5 | import de.terrestris.shoguncore.service.TreeNodeService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | /** 12 | * @author Nils Bühner 13 | */ 14 | @Controller 15 | @RequestMapping("/treenodes") 16 | public class TreeNodeController, S extends TreeNodeService> 17 | extends AbstractWebController { 18 | 19 | /** 20 | * Default constructor, which calls the type-constructor 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public TreeNodeController() { 24 | this((Class) TreeNode.class); 25 | } 26 | 27 | /** 28 | * Constructor that sets the concrete entity class for the controller. 29 | * Subclasses MUST call this constructor. 30 | */ 31 | protected TreeNodeController(Class entityClass) { 32 | super(entityClass); 33 | } 34 | 35 | /** 36 | * We have to use {@link Qualifier} to define the correct service here. 37 | * Otherwise, spring can not decide which service has to be autowired here 38 | * as there are multiple candidates. 39 | */ 40 | @Override 41 | @Autowired 42 | @Qualifier("treeNodeService") 43 | public void setService(S service) { 44 | this.service = service; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/web/WpsParameterController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package de.terrestris.shoguncore.web; 5 | 6 | import de.terrestris.shoguncore.dao.WpsParameterDao; 7 | import de.terrestris.shoguncore.model.wps.WpsParameter; 8 | import de.terrestris.shoguncore.service.WpsParameterService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Qualifier; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | /** 15 | * @author Nils Bühner 16 | */ 17 | @Controller 18 | @RequestMapping("/wpsparameters") 19 | public class WpsParameterController, S extends WpsParameterService> 20 | extends AbstractWebController { 21 | 22 | /** 23 | * Default constructor, which calls the type-constructor 24 | */ 25 | @SuppressWarnings("unchecked") 26 | public WpsParameterController() { 27 | this((Class) WpsParameter.class); 28 | } 29 | 30 | /** 31 | * Constructor that sets the concrete entity class for the controller. 32 | * Subclasses MUST call this constructor. 33 | */ 34 | protected WpsParameterController(Class entityClass) { 35 | super(entityClass); 36 | } 37 | 38 | /** 39 | * We have to use {@link Qualifier} to define the correct service here. 40 | * Otherwise, spring can not decide which service has to be autowired here 41 | * as there are multiple candidates. 42 | */ 43 | @Override 44 | @Autowired 45 | @Qualifier("wpsParameterService") 46 | public void setService(S service) { 47 | this.service = service; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/web/WpsPluginController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package de.terrestris.shoguncore.web; 5 | 6 | import de.terrestris.shoguncore.dao.WpsPluginDao; 7 | import de.terrestris.shoguncore.model.wps.WpsPlugin; 8 | import de.terrestris.shoguncore.service.WpsPluginService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Qualifier; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | /** 15 | * @author Nils Bühner 16 | */ 17 | @Controller 18 | @RequestMapping("/wpsplugins") 19 | public class WpsPluginController, S extends WpsPluginService> 20 | extends PluginController { 21 | 22 | /** 23 | * Default constructor, which calls the type-constructor 24 | */ 25 | @SuppressWarnings("unchecked") 26 | public WpsPluginController() { 27 | this((Class) WpsPlugin.class); 28 | } 29 | 30 | /** 31 | * Constructor that sets the concrete entity class for the controller. 32 | * Subclasses MUST call this constructor. 33 | */ 34 | protected WpsPluginController(Class entityClass) { 35 | super(entityClass); 36 | } 37 | 38 | /** 39 | * We have to use {@link Qualifier} to define the correct service here. 40 | * Otherwise, spring can not decide which service has to be autowired here 41 | * as there are multiple candidates. 42 | */ 43 | @Override 44 | @Autowired 45 | @Qualifier("wpsPluginService") 46 | public void setService(S service) { 47 | this.service = service; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/web/WpsPrimitiveController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package de.terrestris.shoguncore.web; 5 | 6 | import de.terrestris.shoguncore.dao.WpsPrimitiveDao; 7 | import de.terrestris.shoguncore.model.wps.WpsPrimitive; 8 | import de.terrestris.shoguncore.service.WpsPrimitiveService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Qualifier; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | /** 15 | * @author Nils Bühner 16 | */ 17 | @Controller 18 | @RequestMapping("/wpsprimitives") 19 | public class WpsPrimitiveController, S extends WpsPrimitiveService> 20 | extends WpsParameterController { 21 | 22 | /** 23 | * Default constructor, which calls the type-constructor 24 | */ 25 | @SuppressWarnings("unchecked") 26 | public WpsPrimitiveController() { 27 | this((Class) WpsPrimitive.class); 28 | } 29 | 30 | /** 31 | * Constructor that sets the concrete entity class for the controller. 32 | * Subclasses MUST call this constructor. 33 | */ 34 | protected WpsPrimitiveController(Class entityClass) { 35 | super(entityClass); 36 | } 37 | 38 | /** 39 | * We have to use {@link Qualifier} to define the correct service here. 40 | * Otherwise, spring can not decide which service has to be autowired here 41 | * as there are multiple candidates. 42 | */ 43 | @Override 44 | @Autowired 45 | @Qualifier("wpsPrimitiveService") 46 | public void setService(S service) { 47 | this.service = service; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/main/java/de/terrestris/shoguncore/web/WpsReferenceController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package de.terrestris.shoguncore.web; 5 | 6 | import de.terrestris.shoguncore.dao.WpsReferenceDao; 7 | import de.terrestris.shoguncore.model.wps.WpsReference; 8 | import de.terrestris.shoguncore.service.WpsReferenceService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Qualifier; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | /** 15 | * @author Nils Bühner 16 | */ 17 | @Controller 18 | @RequestMapping("/wpsreferences") 19 | public class WpsReferenceController, S extends WpsReferenceService> 20 | extends WpsParameterController { 21 | 22 | /** 23 | * Default constructor, which calls the type-constructor 24 | */ 25 | @SuppressWarnings("unchecked") 26 | public WpsReferenceController() { 27 | this((Class) WpsReference.class); 28 | } 29 | 30 | /** 31 | * Constructor that sets the concrete entity class for the controller. 32 | * Subclasses MUST call this constructor. 33 | */ 34 | protected WpsReferenceController(Class entityClass) { 35 | super(entityClass); 36 | } 37 | 38 | /** 39 | * We have to use {@link Qualifier} to define the correct service here. 40 | * Otherwise, spring can not decide which service has to be autowired here 41 | * as there are multiple candidates. 42 | */ 43 | @Override 44 | @Autowired 45 | @Qualifier("wpsReferenceService") 46 | public void setService(S service) { 47 | this.service = service; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/security/access/entity/ApplicationPermissionEvaluatorTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package de.terrestris.shoguncore.security.access.entity; 5 | 6 | import de.terrestris.shoguncore.model.Application; 7 | 8 | /** 9 | * @author Nils Bühner 10 | */ 11 | public class ApplicationPermissionEvaluatorTest extends 12 | AbstractPersistentObjectPermissionEvaluatorTest { 13 | 14 | public ApplicationPermissionEvaluatorTest() { 15 | super(Application.class, new PersistentObjectPermissionEvaluator<>(Application.class), new Application()); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/security/access/entity/LayoutPermissionEvaluatorTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.security.access.entity; 2 | 3 | import de.terrestris.shoguncore.model.layout.Layout; 4 | 5 | /** 6 | * The {@link Layout} class is used as an example class for unsecured objects. 7 | * 8 | * @author Nils Bühner 9 | */ 10 | public class LayoutPermissionEvaluatorTest extends 11 | AbstractPersistentObjectPermissionEvaluatorTest { 12 | 13 | public LayoutPermissionEvaluatorTest() { 14 | super(Layout.class, new PersistentObjectPermissionEvaluator<>(Layout.class), new Layout()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/service/ApplicationServiceTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.ApplicationDao; 4 | import de.terrestris.shoguncore.model.Application; 5 | 6 | public class ApplicationServiceTest extends 7 | PermissionAwareCrudServiceTest, ApplicationService>> { 8 | 9 | /** 10 | * @throws Exception 11 | */ 12 | @Override 13 | public void setUpImplToTest() throws Exception { 14 | implToTest = new Application(); 15 | } 16 | 17 | @Override 18 | protected ApplicationService> getCrudService() { 19 | return new ApplicationService>(); 20 | } 21 | 22 | @SuppressWarnings("unchecked") 23 | @Override 24 | protected Class> getDaoClass() { 25 | return (Class>) new ApplicationDao().getClass(); 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/service/PasswordResetTokenServiceTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.PasswordResetTokenDao; 4 | import de.terrestris.shoguncore.model.User; 5 | import de.terrestris.shoguncore.model.token.PasswordResetToken; 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | public class PasswordResetTokenServiceTest extends 11 | AbstractUserTokenServiceTest, PasswordResetTokenService>> { 12 | 13 | @Override 14 | protected PasswordResetTokenService> getCrudService() { 15 | return new PasswordResetTokenService>(); 16 | } 17 | 18 | @Override 19 | protected PasswordResetToken getExpiredUserToken() { 20 | return new PasswordResetToken(new User(), -1); 21 | } 22 | 23 | @Override 24 | protected PasswordResetToken getUserTokenWithoutUser() { 25 | return new PasswordResetToken(null); 26 | } 27 | 28 | @SuppressWarnings("unchecked") 29 | @Override 30 | protected Class> getDaoClass() { 31 | return (Class>) new PasswordResetTokenDao() 32 | .getClass(); 33 | } 34 | 35 | @Override 36 | public void setUpImplToTest() throws Exception { 37 | implToTest = new PasswordResetToken(new User()); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/service/PermissionCollectionServiceTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.PermissionCollectionDao; 4 | import de.terrestris.shoguncore.model.security.PermissionCollection; 5 | 6 | public class PermissionCollectionServiceTest extends 7 | AbstractCrudServiceTest, 9 | PermissionCollectionService>> { 10 | 11 | /** 12 | * @throws Exception 13 | */ 14 | public void setUpImplToTest() throws Exception { 15 | implToTest = new PermissionCollection(); 16 | } 17 | 18 | @Override 19 | protected PermissionCollectionService> getCrudService() { 20 | return new PermissionCollectionService>(); 21 | } 22 | 23 | @SuppressWarnings("unchecked") 24 | @Override 25 | protected Class> getDaoClass() { 26 | return (Class>) new PermissionCollectionDao().getClass(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/service/PersonServiceTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.PersonDao; 4 | import de.terrestris.shoguncore.model.Person; 5 | 6 | public class PersonServiceTest extends 7 | PermissionAwareCrudServiceTest, PersonService>> { 8 | 9 | /** 10 | * @throws Exception 11 | */ 12 | public void setUpImplToTest() throws Exception { 13 | implToTest = new Person(); 14 | } 15 | 16 | @Override 17 | protected PersonService> getCrudService() { 18 | return new PersonService>(); 19 | } 20 | 21 | @SuppressWarnings("unchecked") 22 | @Override 23 | protected Class> getDaoClass() { 24 | return (Class>) new PersonDao().getClass(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/service/RegistrationTokenServiceTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.RegistrationTokenDao; 4 | import de.terrestris.shoguncore.model.User; 5 | import de.terrestris.shoguncore.model.token.RegistrationToken; 6 | 7 | /** 8 | * @author Nils Bühner 9 | */ 10 | public class RegistrationTokenServiceTest extends 11 | AbstractUserTokenServiceTest, RegistrationTokenService>> { 12 | 13 | @Override 14 | protected RegistrationTokenService> getCrudService() { 15 | return new RegistrationTokenService>(); 16 | } 17 | 18 | @Override 19 | protected RegistrationToken getExpiredUserToken() { 20 | return new RegistrationToken(new User(), -1); 21 | } 22 | 23 | @Override 24 | protected RegistrationToken getUserTokenWithoutUser() { 25 | return new RegistrationToken(null); 26 | } 27 | 28 | @SuppressWarnings("unchecked") 29 | @Override 30 | protected Class> getDaoClass() { 31 | return (Class>) new RegistrationTokenDao().getClass(); 32 | } 33 | 34 | @Override 35 | public void setUpImplToTest() throws Exception { 36 | implToTest = new RegistrationToken(new User()); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/service/UserGroupServiceTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.service; 2 | 3 | import de.terrestris.shoguncore.dao.UserGroupDao; 4 | import de.terrestris.shoguncore.model.UserGroup; 5 | 6 | public class UserGroupServiceTest extends 7 | PermissionAwareCrudServiceTest, UserGroupService>> { 8 | 9 | /** 10 | * @throws Exception 11 | */ 12 | public void setUpImplToTest() throws Exception { 13 | implToTest = new UserGroup(); 14 | } 15 | 16 | @Override 17 | protected UserGroupService> getCrudService() { 18 | return new UserGroupService>(); 19 | } 20 | 21 | @SuppressWarnings("unchecked") 22 | @Override 23 | protected Class> getDaoClass() { 24 | return (Class>) new UserGroupDao().getClass(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/util/interceptor/InterceptorExceptionTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.util.interceptor; 2 | 3 | import org.junit.Test; 4 | 5 | public class InterceptorExceptionTest { 6 | 7 | private static final String EXCEPTION_MESSAGE = "Shinji!"; 8 | 9 | @Test(expected = InterceptorException.class) 10 | public void throw_exception_empty() throws InterceptorException { 11 | throw new InterceptorException(); 12 | } 13 | 14 | @Test(expected = InterceptorException.class) 15 | public void throw_exception_message() throws InterceptorException { 16 | throw new InterceptorException(EXCEPTION_MESSAGE); 17 | } 18 | 19 | @Test(expected = InterceptorException.class) 20 | public void throw_exception_throwable() throws InterceptorException { 21 | throw new InterceptorException(new Throwable()); 22 | } 23 | 24 | @Test(expected = InterceptorException.class) 25 | public void throw_exception_message_throwable() throws InterceptorException { 26 | throw new InterceptorException(EXCEPTION_MESSAGE, new Throwable()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/web/ModuleControllerTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.web; 2 | 3 | import de.terrestris.shoguncore.service.ModuleService; 4 | import org.junit.Before; 5 | import org.junit.Test; 6 | import org.mockito.Mock; 7 | import org.mockito.MockitoAnnotations; 8 | import org.springframework.test.web.servlet.MockMvc; 9 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 10 | 11 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; 12 | 13 | /** 14 | * Test class for {@link ModuleController} 15 | * 16 | * @author Andre Henn 17 | */ 18 | public class ModuleControllerTest { 19 | 20 | private MockMvc mockMvc; 21 | 22 | /** 23 | * The controller to test 24 | */ 25 | private ModuleController moduleController; 26 | 27 | @Mock(name="moduleService") 28 | private ModuleService moduleService; 29 | 30 | @Before 31 | public void setUp() { 32 | // Process mock annotations 33 | MockitoAnnotations.initMocks(this); 34 | 35 | this.moduleController = new ModuleController(); 36 | this.moduleController.setService(moduleService); 37 | 38 | // Setup Spring test in standalone mode 39 | this.mockMvc = MockMvcBuilders.standaloneSetup(moduleController).build(); 40 | } 41 | 42 | @Test 43 | public void findAllRequestMappings() throws Exception { 44 | // Perform and test the GET-Request 45 | mockMvc.perform(get("/module")); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/web/TreeNodeControllerTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.web; 2 | 3 | import de.terrestris.shoguncore.service.TreeNodeService; 4 | import org.junit.Before; 5 | import org.junit.Test; 6 | import org.mockito.Mock; 7 | import org.mockito.MockitoAnnotations; 8 | import org.springframework.test.web.servlet.MockMvc; 9 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 10 | 11 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; 12 | 13 | /** 14 | * TODO: add documentation 15 | * 16 | * @author Andre Henn 17 | */ 18 | public class TreeNodeControllerTest { 19 | 20 | private MockMvc mockMvc; 21 | 22 | /** 23 | * The controller to test 24 | */ 25 | private TreeNodeController treeNodeController; 26 | 27 | @Mock(name="treeNodeService") 28 | private TreeNodeService treeNodeService; 29 | 30 | @Before 31 | public void setUp() { 32 | // Process mock annotations 33 | MockitoAnnotations.initMocks(this); 34 | 35 | this.treeNodeController = new TreeNodeController(); 36 | this.treeNodeController.setService(treeNodeService); 37 | 38 | // Setup Spring test in standalone mode 39 | this.mockMvc = MockMvcBuilders.standaloneSetup(treeNodeController).build(); 40 | } 41 | 42 | @Test 43 | public void findAllRequestMappings() throws Exception { 44 | // Perform and test the GET-Request 45 | mockMvc.perform(get("/treenodes")); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/web/WpsParameterControllerTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.web; 2 | 3 | import de.terrestris.shoguncore.service.WpsParameterService; 4 | import org.junit.Before; 5 | import org.junit.Test; 6 | import org.mockito.Mock; 7 | import org.mockito.MockitoAnnotations; 8 | import org.springframework.test.web.servlet.MockMvc; 9 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 10 | 11 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; 12 | 13 | /** 14 | * Test class for {@link WpsParameterController} 15 | * 16 | * @author Andre Henn 17 | */ 18 | public class WpsParameterControllerTest { 19 | 20 | private MockMvc mockMvc; 21 | 22 | /** 23 | * The controller to test 24 | */ 25 | private WpsParameterController wpsParameterController; 26 | 27 | @Mock(name="wpsParameterService") 28 | private WpsParameterService wpsParameterService; 29 | 30 | @Before 31 | public void setUp() { 32 | // Process mock annotations 33 | MockitoAnnotations.initMocks(this); 34 | 35 | this.wpsParameterController = new WpsParameterController(); 36 | this.wpsParameterController.setService(wpsParameterService); 37 | 38 | // Setup Spring test in standalone mode 39 | this.mockMvc = MockMvcBuilders.standaloneSetup(wpsParameterController).build(); 40 | } 41 | 42 | @Test 43 | public void findAllRequestMappings() throws Exception { 44 | // Perform and test the GET-Request 45 | mockMvc.perform(get("/wpsparameters")); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/web/WpsPluginControllerTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.web; 2 | 3 | import de.terrestris.shoguncore.service.WpsPluginService; 4 | import org.junit.Before; 5 | import org.junit.Test; 6 | import org.mockito.Mock; 7 | import org.mockito.MockitoAnnotations; 8 | import org.springframework.test.web.servlet.MockMvc; 9 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 10 | 11 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; 12 | 13 | /** 14 | * Test class for {@link WpsPluginController} 15 | * 16 | * @author Andre Henn 17 | */ 18 | public class WpsPluginControllerTest { 19 | 20 | private MockMvc mockMvc; 21 | 22 | /** 23 | * The controller to test 24 | */ 25 | private WpsPluginController wpsPluginController; 26 | 27 | @Mock(name="wpsPluginService") 28 | private WpsPluginService wpsPluginService; 29 | 30 | @Before 31 | public void setUp() { 32 | // Process mock annotations 33 | MockitoAnnotations.initMocks(this); 34 | 35 | this.wpsPluginController = new WpsPluginController(); 36 | this.wpsPluginController.setService(wpsPluginService); 37 | 38 | // Setup Spring test in standalone mode 39 | this.mockMvc = MockMvcBuilders.standaloneSetup(wpsPluginController).build(); 40 | } 41 | 42 | @Test 43 | public void findAllRequestMappings() throws Exception { 44 | // Perform and test the GET-Request 45 | mockMvc.perform(get("/wpsplugins")); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/java/de/terrestris/shoguncore/web/WpsPrimitiveControllerTest.java: -------------------------------------------------------------------------------- 1 | package de.terrestris.shoguncore.web; 2 | 3 | import de.terrestris.shoguncore.service.WpsPrimitiveService; 4 | import org.junit.Before; 5 | import org.junit.Test; 6 | import org.mockito.Mock; 7 | import org.mockito.MockitoAnnotations; 8 | import org.springframework.test.web.servlet.MockMvc; 9 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 10 | 11 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; 12 | 13 | /** 14 | * TODO: add documentation 15 | * 16 | * @author Andre Henn 17 | */ 18 | public class WpsPrimitiveControllerTest { 19 | 20 | private MockMvc mockMvc; 21 | 22 | /** 23 | * The controller to test 24 | */ 25 | private WpsPrimitiveController wpsPrimitiveController; 26 | 27 | @Mock(name="wpsPrimitiveService") 28 | private WpsPrimitiveService wpsPrimitiveService; 29 | 30 | @Before 31 | public void setUp() { 32 | // Process mock annotations 33 | MockitoAnnotations.initMocks(this); 34 | 35 | this.wpsPrimitiveController = new WpsPrimitiveController(); 36 | this.wpsPrimitiveController.setService(wpsPrimitiveService); 37 | 38 | // Setup Spring test in standalone mode 39 | this.mockMvc = MockMvcBuilders.standaloneSetup(wpsPrimitiveController).build(); 40 | } 41 | 42 | @Test 43 | public void findAllRequestMappings() throws Exception { 44 | // Perform and test the GET-Request 45 | mockMvc.perform(get("/wpsprimitives")); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/hibernate.properties: -------------------------------------------------------------------------------- 1 | # base 2 | hibernate.dialect=org.hibernate.dialect.H2Dialect 3 | hibernate.show_sql=false 4 | hibernate.id.new_generator_mappings=true 5 | hibernate.hbm2ddl.auto=create 6 | 7 | # caching 8 | hibernate.cache.use_query_cache=false 9 | #hibernate.cache.use_second_level_cache=true 10 | #hibernate.cache.use_query_cache=true 11 | #hibernate.cache.region.factory_class=org.hibernate.cache.jcache.JCacheRegionFactory 12 | 13 | # other 14 | #hibernate.max_fetch_depth=4 15 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/hikari.properties: -------------------------------------------------------------------------------- 1 | # class of data source 2 | hikari.dataSourceClassName=org.h2.jdbcx.JdbcDataSource 3 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverClassName=org.h2.Driver 2 | jdbc.url=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 3 | jdbc.username=admin 4 | jdbc.password= 5 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/locale/component_empty.csv: -------------------------------------------------------------------------------- 1 | component;field;de;en 2 | MyProject.some.Component;config.data.title;"de:title;and something after a semicolon";en:foobar 3 | ;config.data.tooltip;de:tooltip;en:tooltip 4 | MyProject.some.Component;config.data.dragText;{0} Zeile(n) ausgewählt;{0} line(s) selected 5 | MyProject.another.Component;justonefield;de:foo;en:foo 6 | MyProject.another.Component;data.a;de:data.a;en:data.a 7 | MyProject.another.Component;data.b;de:data.b;en:data.b 8 | MyProject.yet.another.Component;config.myArray[];de:v1,v2,v3, ...;en:v1,v2,v3, ... 9 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/locale/empty.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrestris/shogun-core/d1881aa2f2c41d00d308ff7f794c34c76dd5a925/src/shogun-core-main/src/test/resources/META-INF/locale/empty.csv -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/locale/field_empty.csv: -------------------------------------------------------------------------------- 1 | component;field;de;en 2 | MyProject.some.Component;config.data.title;"de:title;and something after a semicolon";en:foobar 3 | MyProject.some.Component;;de:tooltip;en:tooltip 4 | MyProject.some.Component;config.data.dragText;{0} Zeile(n) ausgewählt;{0} line(s) selected 5 | MyProject.another.Component;justonefield;de:foo;en:foo 6 | MyProject.another.Component;data.a;de:data.a;en:data.a 7 | MyProject.another.Component;data.b;de:data.b;en:data.b 8 | MyProject.yet.another.Component;config.myArray[];de:v1,v2,v3, ...;en:v1,v2,v3, ... 9 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/locale/field_unsupported_array.csv: -------------------------------------------------------------------------------- 1 | component;field;de;en 2 | MyProject.some.Component;config.data.title;"de:title;and something after a semicolon";en:foobar 3 | MyProject.some.Component;config.data.tooltip;de:tooltip;en:tooltip 4 | MyProject.some.Component;config.data.dragText;{0} Zeile(n) ausgewählt;{0} line(s) selected 5 | MyProject.another.Component;justonefield;de:foo;en:foo 6 | MyProject.another.Component;data.a;de:data.a;en:data.a 7 | MyProject.another.Component;data.b;de:data.b;en:data.b 8 | MyProject.yet.another.Component;config[].myArray[];de:v1,v2,v3, ...;en:v1,v2,v3, ... 9 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/locale/invalid.csv: -------------------------------------------------------------------------------- 1 | component;field 2 | MyProject.some.Component;config.data.title; 3 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/locale/test.csv: -------------------------------------------------------------------------------- 1 | component;field;de;en 2 | MyProject.some.Component;config.data.title;"de:title;and something after a semicolon";en:foobar 3 | MyProject.some.Component;config.data.tooltip;de:tooltip;en:tooltip 4 | MyProject.some.Component;config.data.dragText;{0} Zeile(n) ausgewählt;{0} line(s) selected 5 | MyProject.another.Component;justonefield;de:foo;en:foo 6 | MyProject.another.Component;data.a;de:data.a;en:data.a 7 | MyProject.another.Component;data.b;de:data.b;en:data.b 8 | MyProject.yet.another.Component;config.myArray[];de:v1,v2,v3, ...;en:v1,v2,v3, ... 9 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrestris/shogun-core/d1881aa2f2c41d00d308ff7f794c34c76dd5a925/src/shogun-core-main/src/test/resources/META-INF/logo.png -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/shogun2.properties: -------------------------------------------------------------------------------- 1 | ##################################### 2 | ##### Application Configuration ##### 3 | ##################################### 4 | 5 | # The name of the SUPERADMIN role 6 | # (a user with this role is allowed to do everything) 7 | role.superAdminRoleName=ROLE_ADMIN 8 | 9 | # The name of the default user role 10 | role.defaultUserRoleName=ROLE_USER 11 | 12 | # The Mail Server 13 | mail.server.host=localhost 14 | mail.server.port=3025 15 | mail.server.transportProtocol=smtp 16 | mail.server.smtpAuth=true 17 | mail.server.smtpStartTlsEnable=true 18 | mail.server.username=test@shogun-mail.de 19 | mail.server.password=test 20 | 21 | # The default mail sender address 22 | mail.defaultSender=noreply@shogun.de 23 | 24 | # A mail template being used as confirmation mail after registration 25 | mail.registrationMailTemplateSubject=Activate your account on SHOGun.de 26 | mail.registrationMailTemplateText=\ 27 | Dear %s,\n\ 28 | \n\ 29 | Welcome to SHOGun!\n\ 30 | \n\ 31 | Before you can start working with SHOGun.de and all of it's great features, \n\ 32 | you need to confirm your account. To get started, just confirm your email \n\ 33 | address by clicking the link below:\n\ 34 | \n\ 35 | %s \n\ 36 | \n\ 37 | If you need any help, get in touch with us at https://support.shogun.de/.\n\ 38 | \n\ 39 | Yours,\n\ 40 | The SHOGun Team\n\ 41 | \n\ 42 | Note: This email has been automatically generated. Please \n \ 43 | do not reply to this email address as all responses \n \ 44 | are directed to an unattended mailbox and will not \n \ 45 | receive a response. 46 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/spring/test-encoder-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/META-INF/spring/test-locale.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/shogun-core-main/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | 7 | de.terrestris 8 | shogun-core 9 | 5.3.14-SNAPSHOT 10 | 11 | 12 | shogun-core-webapp-archetype 13 | maven-archetype 14 | 15 | SHOGun-Core (Webapp Archetype) 16 | 17 | 18 | 19 | 20 | 21 | org.apache.maven.archetype 22 | archetype-packaging 23 | 2.3 24 | 25 | 26 | 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-resources-plugin 31 | 32 | true 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | maven-archetype-plugin 42 | 3.2.0 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/dao/ProjectApplicationDao.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.dao; 5 | 6 | import org.springframework.stereotype.Repository; 7 | 8 | import ${package}.model.ProjectApplication; 9 | import de.terrestris.shoguncore.dao.ApplicationDao; 10 | import de.terrestris.shoguncore.model.Application; 11 | 12 | /** 13 | * This is a demo DAO that demonstrates how a SHOGun-Core DAO can be extended. 14 | * 15 | * @author Nils Bühner 16 | * 17 | * @param 18 | */ 19 | @Repository("projectApplicationDao") 20 | public class ProjectApplicationDao extends ApplicationDao { 21 | 22 | /** 23 | * Public default constructor for this DAO. 24 | */ 25 | @SuppressWarnings("unchecked") 26 | public ProjectApplicationDao() { 27 | super((Class) ProjectApplication.class); 28 | } 29 | 30 | /** 31 | * Constructor that has to be called by subclasses. 32 | * 33 | * @param clazz 34 | */ 35 | protected ProjectApplicationDao(Class clazz) { 36 | super(clazz); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/init/ProjectContentInitializer.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.init; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | 9 | import de.terrestris.shoguncore.init.ContentInitializer; 10 | 11 | /** 12 | * This is a demo class that demonstrates how the SHOGun-Core 13 | * {@link ContentInitializer} can be extended. 14 | * 15 | * @author Nils Bühner 16 | * 17 | */ 18 | public class ProjectContentInitializer extends ContentInitializer { 19 | 20 | /** 21 | * Flag symbolizing if something should be initialized on startup 22 | */ 23 | @Autowired 24 | @Qualifier("projectInitEnabled") 25 | private Boolean projectInitEnabled; 26 | 27 | @Override 28 | public void initializeDatabaseContent() { 29 | 30 | super.initializeDatabaseContent(); 31 | 32 | if(projectInitEnabled){ 33 | // init project specific stuff... 34 | LOG.info("Initializing project specific stuff..."); 35 | } 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/model/ProjectApplication.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.model; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | 9 | import de.terrestris.shoguncore.model.Application; 10 | 11 | /** 12 | * This is a demo extension of a SHOGun-Core model. 13 | * 14 | * @author Nils Bühner 15 | * 16 | */ 17 | @Entity 18 | public class ProjectApplication extends Application { 19 | 20 | private static final long serialVersionUID = 1L; 21 | 22 | @Column 23 | private String projectSpecificString; 24 | 25 | @Column 26 | private Integer projectSpecificInteger; 27 | 28 | public ProjectApplication() { 29 | } 30 | 31 | public String getProjectSpecificString() { 32 | return projectSpecificString; 33 | } 34 | 35 | public void setProjectSpecificString(String projectSpecificString) { 36 | this.projectSpecificString = projectSpecificString; 37 | } 38 | 39 | public Integer getProjectSpecificInteger() { 40 | return projectSpecificInteger; 41 | } 42 | 43 | public void setProjectSpecificInteger(Integer projectSpecificInteger) { 44 | this.projectSpecificInteger = projectSpecificInteger; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/rest/ProjectApplicationRestController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.rest; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | {package}.dao.ProjectApplicationDao; 12 | import ${package}.model.ProjectApplication; 13 | {package}.service.ProjectApplicationService; 14 | import de.terrestris.shoguncore.rest.ApplicationRestController; 15 | 16 | /** 17 | * This is a demo controller that demonstrates how SHOGun-Core REST controllers 18 | * can be extended. 19 | * 20 | * @author Nils Bühner 21 | * 22 | */ 23 | @RestController 24 | @RequestMapping("/projectapplications") 25 | public class ProjectApplicationRestController, S extends ProjectApplicationService> 26 | extends ApplicationRestController { 27 | 28 | /** 29 | * We have to use {@link Qualifier} to define the correct service here. 30 | * Otherwise, spring can not decide which service has to be autowired here 31 | * as there are multiple candidates. 32 | */ 33 | @Override 34 | @Autowired 35 | @Qualifier("projectApplicationService") 36 | public void setService(S service) { 37 | this.service = service; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/security/access/factory/ProjectEntityPermissionEvaluatorFactory.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.security.access.factory; 5 | 6 | import ${package}.model.ProjectApplication; 7 | {package}.security.access.entity.ProjectApplicationPermissionEvaluator; 8 | import de.terrestris.shoguncore.model.PersistentObject; 9 | import de.terrestris.shoguncore.security.access.entity.PersistentObjectPermissionEvaluator; 10 | import de.terrestris.shoguncore.security.access.factory.EntityPermissionEvaluatorFactory; 11 | 12 | 13 | /** 14 | * This is just a demo to show how the {@link EntityPermissionEvaluatorFactory} 15 | * from SHOGun-Core can be extended to make use of it in a project specific 16 | * implementation. 17 | * 18 | * This class has to be configured to be used for the permissionEvaluator (of 19 | * SHOGun-Core) in the security XML of this project. 20 | * 21 | * @author Nils Bühner 22 | * 23 | */ 24 | public class ProjectEntityPermissionEvaluatorFactory extends EntityPermissionEvaluatorFactory { 25 | 26 | @Override 27 | @SuppressWarnings({ "rawtypes", "unchecked" }) 28 | public PersistentObjectPermissionEvaluator getEntityPermissionEvaluator( 29 | final Class entityClass) { 30 | 31 | if(ProjectApplication.class.isAssignableFrom(entityClass)) { 32 | return new ProjectApplicationPermissionEvaluator(); 33 | } 34 | 35 | // call SHOGun-Core implementation otherwise 36 | return super.getEntityPermissionEvaluator(entityClass); 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/service/ProjectApplicationService.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.service; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Qualifier; 8 | import org.springframework.stereotype.Service; 9 | 10 | {package}.model.ProjectApplication; 11 | import ${package}.dao.ProjectApplicationDao; 12 | import de.terrestris.shoguncore.service.ApplicationService; 13 | 14 | /** 15 | * This is a demo service that demonstrates how a SHOGun-Core service can be 16 | * extended. 17 | * 18 | * @author Nils Bühner 19 | * 20 | * @param 21 | * @param 22 | */ 23 | @Service("projectApplicationService") 24 | public class ProjectApplicationService> extends 25 | ApplicationService { 26 | 27 | /** 28 | * We have to use {@link Qualifier} to define the correct dao here. 29 | * Otherwise, spring can not decide which dao has to be autowired here 30 | * as there are multiple candidates. 31 | */ 32 | @Override 33 | @Autowired 34 | @Qualifier("projectApplicationDao") 35 | public void setDao(D dao) { 36 | super.setDao(dao); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/util/WcsRequestInterceptor.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.util; 5 | 6 | import de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest; 7 | import de.terrestris.shoguncore.util.interceptor.WcsRequestInterceptorInterface; 8 | 9 | /** 10 | * This class demonstrates how to implement the WcsRequestInterceptorInterface. 11 | * 12 | * @author Daniel Koch 13 | * @author terrestris GmbH & Co. KG 14 | * 15 | */ 16 | public class WcsRequestInterceptor implements WcsRequestInterceptorInterface { 17 | 18 | @Override 19 | public MutableHttpServletRequest interceptGetCapabilities( 20 | MutableHttpServletRequest request) { 21 | return request; 22 | } 23 | 24 | @Override 25 | public MutableHttpServletRequest interceptDescribeCoverage( 26 | MutableHttpServletRequest request) { 27 | return request; 28 | } 29 | 30 | @Override 31 | public MutableHttpServletRequest interceptGetCoverage( 32 | MutableHttpServletRequest request) { 33 | return request; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/util/WcsResponseInterceptor.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.util; 5 | 6 | import de.terrestris.shoguncore.util.interceptor.WcsResponseInterceptorInterface; 7 | import de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest; 8 | import de.terrestris.shoguncore.util.model.Response; 9 | 10 | /** 11 | * This class demonstrates how to implement the WcsResponseInterceptorInterface. 12 | * 13 | * @author Daniel Koch 14 | * @author terrestris GmbH & Co. KG 15 | * 16 | */ 17 | public class WcsResponseInterceptor implements WcsResponseInterceptorInterface{ 18 | 19 | @Override 20 | public Response interceptGetCapabilities(MutableHttpServletRequest request, Response response) { 21 | return response; 22 | } 23 | 24 | @Override 25 | public Response interceptDescribeCoverage(MutableHttpServletRequest request, Response response) { 26 | return response; 27 | } 28 | 29 | @Override 30 | public Response interceptGetCoverage(MutableHttpServletRequest request, Response response) { 31 | return response; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/util/WfsRequestInterceptor.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.util; 5 | 6 | import de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest; 7 | import de.terrestris.shoguncore.util.interceptor.WfsRequestInterceptorInterface; 8 | 9 | /** 10 | * This class demonstrates how to implement the WfsRequestInterceptorInterface. 11 | * 12 | * @author Daniel Koch 13 | * @author terrestris GmbH & Co. KG 14 | * 15 | */ 16 | public class WfsRequestInterceptor implements WfsRequestInterceptorInterface { 17 | 18 | @Override 19 | public MutableHttpServletRequest interceptGetCapabilities( 20 | MutableHttpServletRequest request) { 21 | return request; 22 | } 23 | 24 | @Override 25 | public MutableHttpServletRequest interceptDescribeFeatureType( 26 | MutableHttpServletRequest request) { 27 | return request; 28 | } 29 | 30 | @Override 31 | public MutableHttpServletRequest interceptGetFeature( 32 | MutableHttpServletRequest request) { 33 | return request; 34 | } 35 | 36 | @Override 37 | public MutableHttpServletRequest interceptLockFeature( 38 | MutableHttpServletRequest request) { 39 | return request; 40 | } 41 | 42 | @Override 43 | public MutableHttpServletRequest interceptTransaction( 44 | MutableHttpServletRequest request) { 45 | return request; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/util/WfsResponseInterceptor.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.util; 5 | 6 | import de.terrestris.shoguncore.util.interceptor.WfsResponseInterceptorInterface; 7 | import de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest; 8 | import de.terrestris.shoguncore.util.model.Response; 9 | 10 | /** 11 | * This class demonstrates how to implement the WfsResponseInterceptorInterface. 12 | * 13 | * @author Daniel Koch 14 | * @author terrestris GmbH & Co. KG 15 | * 16 | */ 17 | public class WfsResponseInterceptor implements WfsResponseInterceptorInterface{ 18 | 19 | @Override 20 | public Response interceptGetCapabilities(MutableHttpServletRequest request, Response response) { 21 | return response; 22 | } 23 | 24 | @Override 25 | public Response interceptDescribeFeatureType(MutableHttpServletRequest request, Response response) { 26 | return response; 27 | } 28 | 29 | @Override 30 | public Response interceptGetFeature(MutableHttpServletRequest request, Response response) { 31 | return response; 32 | } 33 | 34 | @Override 35 | public Response interceptLockFeature(MutableHttpServletRequest request, Response response) { 36 | return response; 37 | } 38 | 39 | @Override 40 | public Response interceptTransaction(MutableHttpServletRequest request, Response response) { 41 | return response; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/util/WmsRequestInterceptor.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.util; 5 | 6 | import de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest; 7 | import de.terrestris.shoguncore.util.interceptor.WmsRequestInterceptorInterface; 8 | 9 | /** 10 | * This class demonstrates how to implement the WmsRequestInterceptorInterface. 11 | * 12 | * @author Daniel Koch 13 | * @author terrestris GmbH & Co. KG 14 | * 15 | */ 16 | public class WmsRequestInterceptor implements WmsRequestInterceptorInterface { 17 | 18 | @Override 19 | public MutableHttpServletRequest interceptGetMap( 20 | MutableHttpServletRequest request) { 21 | // Manipulate request as you like… 22 | return request; 23 | } 24 | 25 | @Override 26 | public MutableHttpServletRequest interceptGetCapabilities( 27 | MutableHttpServletRequest request) { 28 | return request; 29 | } 30 | 31 | @Override 32 | public MutableHttpServletRequest interceptGetFeatureInfo( 33 | MutableHttpServletRequest request) { 34 | return request; 35 | } 36 | 37 | @Override 38 | public MutableHttpServletRequest interceptDescribeLayer( 39 | MutableHttpServletRequest request) { 40 | return request; 41 | } 42 | 43 | @Override 44 | public MutableHttpServletRequest interceptGetLegendGraphic( 45 | MutableHttpServletRequest request) { 46 | return request; 47 | } 48 | 49 | @Override 50 | public MutableHttpServletRequest interceptGetStyles( 51 | MutableHttpServletRequest request) { 52 | return request; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/java/util/WmsResponseInterceptor.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.util; 5 | 6 | import de.terrestris.shoguncore.util.interceptor.WmsResponseInterceptorInterface; 7 | import de.terrestris.shoguncore.util.interceptor.MutableHttpServletRequest; 8 | import de.terrestris.shoguncore.util.model.Response; 9 | 10 | /** 11 | * This class demonstrates how to implement the WmsResponseInterceptorInterface. 12 | * 13 | * @author Daniel Koch 14 | * @author terrestris GmbH & Co. KG 15 | * 16 | */ 17 | public class WmsResponseInterceptor implements WmsResponseInterceptorInterface { 18 | 19 | @Override 20 | public Response interceptGetMap(MutableHttpServletRequest request, Response response) { 21 | return response; 22 | } 23 | 24 | @Override 25 | public Response interceptGetCapabilities(MutableHttpServletRequest request, Response response) { 26 | return response; 27 | } 28 | 29 | @Override 30 | public Response interceptGetFeatureInfo(MutableHttpServletRequest request, Response response) { 31 | return response; 32 | } 33 | 34 | @Override 35 | public Response interceptDescribeLayer(MutableHttpServletRequest request, Response response) { 36 | return response; 37 | } 38 | 39 | @Override 40 | public Response interceptGetLegendGraphic(MutableHttpServletRequest request, Response response) { 41 | return response; 42 | } 43 | 44 | @Override 45 | public Response interceptGetStyles(MutableHttpServletRequest request, Response response) { 46 | return response; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/__artifactId__-init.properties: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} 5 | ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} INIT/STARTUP ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} 6 | ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} 7 | 8 | ${symbol_pound} Whether the ContentInitializer (of the SHOGun core) should init content or not 9 | init.shogunInitEnabled=true 10 | 11 | ${symbol_pound} Whether the ProjectContentInitializer (of the this project) should init content or not 12 | init.projectInitEnabled=true 13 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/env.properties: -------------------------------------------------------------------------------- 1 | 2 | env.prj.groupId=${project.groupId} 3 | env.prj.artifactId=${project.artifactId} 4 | env.prj.version=${project.version} 5 | env.prj.packaging=${project.packaging} 6 | env.prj.name=${project.name} 7 | env.prj.description=${project.description} 8 | 9 | env.prj.shogun.version=${shogun.version} 10 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/geoServerNameSpaces.properties: -------------------------------------------------------------------------------- 1 | topp=http://localhost:8080/geoserver/topp/ows 2 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/hibernate.properties: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | ${symbol_pound} base 5 | hibernate.dialect=org.hibernate.dialect.H2Dialect 6 | hibernate.show_sql=false 7 | hibernate.id.new_generator_mappings=true 8 | hibernate.hbm2ddl.auto=create 9 | hibernate.cache.use_query_cache=false 10 | hibernate.cache.use_second_level_cache=false 11 | hibernate.cache.statistics=false 12 | 13 | ${symbol_pound} an optional table name prefix used by the physical naming strategy 14 | ddl.tablePrefix= 15 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/hikari.properties: -------------------------------------------------------------------------------- 1 | # The query used to test connections from the pool 2 | hikari.testQuery=SELECT 1 3 | 4 | #This property controls the maximum size that the pool is allowed to reach, 5 | #including both idle and in-use connections. 6 | hikari.maximumPoolSize=3 7 | 8 | #class of data source 9 | hikari.dataSourceClassName=org.h2.jdbcx.JdbcDataSource 10 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/jdbc.properties: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | jdbc.driverClassName=org.h2.Driver 5 | jdbc.url=jdbc:h2:file:~/h2/${artifactId};AUTO_SERVER=TRUE 6 | jdbc.username=admin 7 | jdbc.password=admin 8 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/proxy.properties: -------------------------------------------------------------------------------- 1 | proxy.whitelist=localhost,\ 2 | localhost:8080,\ 3 | ows.terrestris.de 4 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/__artifactId__-context-init.xml: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/resources/ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 6 | 7 | ${artifactId} Application 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | The content of the document. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/test/resources/projects/basic/archetype.properties: -------------------------------------------------------------------------------- 1 | #Fri Nov 29 11:49:59 CET 2013 2 | package=it.pkg 3 | version=0.1-SNAPSHOT 4 | groupId=archetype.it 5 | artifactId=basic 6 | shogun-parent-package=de.terrestris 7 | webapp-name=shogun-webapp 8 | -------------------------------------------------------------------------------- /src/shogun-core-webapp-archetype/src/test/resources/projects/basic/goal.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrestris/shogun-core/d1881aa2f2c41d00d308ff7f794c34c76dd5a925/src/shogun-core-webapp-archetype/src/test/resources/projects/basic/goal.txt -------------------------------------------------------------------------------- /src/spotbugs/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | --------------------------------------------------------------------------------