Mercurial > dive4elements > river
changeset 9027:274ddafb719b
S-Info-Proof-Init
Testing
author | gernotbelger |
---|---|
date | Thu, 26 Apr 2018 10:46:12 +0200 |
parents | 679b1442c886 |
children | 7f3818ec6eb6 |
files | .hgignore artifacts/doc/conf/backend-db.xml artifacts/doc/conf/conf.xml artifacts/doc/conf/seddb-db.xml backend/contrib/run_geo.sh backend/doc/schema/Dockerfile backend/src/main/java/org/dive4elements/river/backend/SedDBCredentials.java etl/doc/conf.xml gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RecommandationUtils.java gwt-client/src/main/java/org/dive4elements/river/client/test/SinfoProof.java |
diffstat | 10 files changed, 176 insertions(+), 838 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Wed Apr 25 11:58:49 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -syntax: regexp -artifacts/target # maven output -artifacts/\.classpath # eclipse -artifacts/\.project # eclipse -artifacts/\.settings # eclipse -artifacts/test-output # eclipse junit/testng plugin output -backend/target # maven output -backend/\.classpath # eclipse -backend/\.project # eclipse -backend/\.settings # eclipse -backend/test-output # eclipse junit/testng plugin output -gwt-client/target # maven output -gwt-client/\.classpath # eclipse -gwt-client/\.project # eclipse -gwt-client/\.settings # eclipse -gwt-client/test-output # eclipse junit/testng plugin output -gwt-client/src/main/webapp/OpenLayers-2.11 -gwt-client/SmartGWT/.* -etl/target # maven output -etl/\.classpath # eclipse -etl/\.project # eclipse -etl/\.settings # eclipse -etl/test-output # eclipse junit/testng plugin output -\.swp -\.swo -\.pyc -TAGS
--- a/artifacts/doc/conf/backend-db.xml Wed Apr 25 11:58:49 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<backend-database> - <!-- This is the default backend db configuration. --> - <user>d4e</user> - <password>d4e</password> - <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect> - <driver>org.postgresql.Driver</driver> - <url>jdbc:postgresql://localhost:5432/d4e</url> - <validation-query>select 1 from rivers</validation-query> - <max-wait>30000</max-wait> -</backend-database>
--- a/artifacts/doc/conf/conf.xml Wed Apr 25 11:58:49 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,378 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!DOCTYPE artifact-database [ - <!ENTITY artifact-db SYSTEM "artifact-db.xml"> - <!ENTITY datacage-db SYSTEM "datacage-db.xml"> - <!ENTITY backend-db SYSTEM "backend-db.xml"> - <!ENTITY seddb-db SYSTEM "seddb-db.xml"> - <!ENTITY rest-server SYSTEM "rest-server.xml"> - <!ENTITY floodmap SYSTEM "floodmap.xml"> - <!ENTITY rivermap SYSTEM "rivermap.xml"> - <!ENTITY generators SYSTEM "generators/generators.xml"> - <!ENTITY zoom-scales SYSTEM "zoom-scales.xml"> - <!ENTITY modules SYSTEM "modules.xml"> - <!ENTITY porosity-artifact SYSTEM "artifacts/porosity.xml"> - <!ENTITY gaugedischargecurve-artifact SYSTEM "artifacts/gaugedischargecurve.xml"> - <!ENTITY sqrelation-artifact SYSTEM "artifacts/sqrelation.xml"> - <!ENTITY sqrelation-datacage-artifact SYSTEM "artifacts/sqrelation-datacage.xml"> - <!ENTITY sedimentload-artifact SYSTEM "artifacts/sedimentload.xml"> - <!ENTITY sedimentload-ls-artifact SYSTEM "artifacts/sedimentload-ls.xml"> - - <!ENTITY discharge-diagrams SYSTEM "generators/discharge-diagrams.xml"> - <!ENTITY longitudinal-diagrams SYSTEM "generators/longitudinal-diagrams.xml"> - <!ENTITY sqrelation-defaults SYSTEM "generators/sqrelation-diagram-defaults.xml"> - <!ENTITY longitudinal-defaults SYSTEM "generators/longitudinal-diagram-defaults.xml"> - <!ENTITY discharge-defaults SYSTEM "generators/discharge-diagram-defaults.xml"> - - <!ENTITY sinfo_artifact SYSTEM "artifacts/sinfo.xml"> - <!ENTITY uinfo_artifact SYSTEM "artifacts/uinfo.xml"> -]> -<artifact-database> - <export-secret>YOUR_SECRET</export-secret> - <factories> - <context-factory>org.dive4elements.river.artifacts.context.RiverContextFactory</context-factory> - - <collection-factory - name="DefaultArtifactCollectionFactory" - description="The default artifact collection factory" - ttl="21600000" - artifact-collection="org.dive4elements.river.collections.D4EArtifactCollection">org.dive4elements.artifactdatabase.DefaultArtifactCollectionFactory</collection-factory> - - <artifact-factories> - <!-- All Artifactfactories which are available in this Database. --> - <artifact-factory name="winfo" description="Factory to create an artifact to be used in WINFO" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WINFOArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="riveraxis" description="Factory to create an artifact to be used in WINFO" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.RiverAxisArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="hyk" description="Factory to create an artifact to be used for hyks" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.HYKArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="new_map" description="Factory to create an artifact to be used for new map" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.MapArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmskmfactory" description="Factory to create an artifact that generates WMS facets for KMs." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSKmArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmsqpsfactory" description="Factory to create an artifact that generates WMS facets for CrossSectionTracks." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSQPSArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmshydrboundariesfactory" description="Factory to create an artifact that generates WMS facets for CrossSectionTracks." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSHydrBoundaryArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmshydrboundariespolyfactory" description="Factory to create an artifact that generates WMS facets for CrossSectionTracks." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSHydrBoundaryPolyArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmsfloodplainfactory" description="Factory to create an artifact that generates WMS facets for CrossSectionTracks." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSFloodplainArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmsbuildingsfactory" description="Factory to create an artifact to be used in WINFO" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSBuildingsArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmsfixpointsfactory" description="Factory to create an artifact to be used in WINFO" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSFixpointsArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmsfloodmarkfactory" description="Factory to create an artifact to be used in WINFO" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSFloodmarksArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmsfloodmapsfactory" description="Factory to create an artifact to be used in WINFO" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSFloodmapsArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmsbackground" description="Factory to create an artifact to be used in WINFO" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSBackgroundArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="externalwmsfactory" description="Factory to create an artifact to be used in Floodmaps to display external WMS layers" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.ExternalWMSArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="annotations" description="Factory to create an artifact to access Annotations for Points at rivers" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.AnnotationArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="crosssections" description="Factory to create an artifact to access cross sections" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.CrossSectionArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="waterlevel" description="Factory to create an artifact to access waterlevel data" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WaterlevelArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="mainvalue" description="Factory to create an artifact to access Main Values for discharge curve diagrams" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.MainValuesArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="staticwkms" description="Factory to create an artifact to access 'other' WKms data" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.StaticWKmsArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="area" description="Factory to create an artifact to draw (wkms) area data" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.AreaArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="staticwqkms" description="Factory to create an artifact to access 'other' WKms data" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.StaticWQKmsArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wqinterpol" description="Factory to create an artifact to access 'other' WQ (at km) data" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WQKmsInterpolArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="new_chart" description="Factory to create an artifact to be used for new chart" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.ChartArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="manualpoints" description="Factory to create an artifact for storing and editing points added by the user." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.ManualPointsArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="fixanalysis" description="Factory to create an artifact to be used in fixation analysis." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.FixationArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="gaugedischarge" description="Factory to create an artifact to host historical qs." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.GaugeDischargeArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="qsectors" description="Factory to create an artifact to host qsectors." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.QSectorArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmshwslinesfactory" description="Factory to create an artifact that generates WMS facets for HWS Lines" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSHWSLinesArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmshwspointsfactory" description="Factory to create an artifact that generates WMS facets for HWS Points" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSHWSPointsArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="wmsjettiesfactory" description="Factory to create an artifact to be used in WINFO" - ttl="3600000" - artifact="org.dive4elements.river.artifacts.WMSJettiesArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - - <!-- MINFO specific Artifacts --> - <artifact-factory name="minfo" description="Factory to create an artifact to be used in module minfo." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.MINFOArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="bedheight" description="Factory to create an artifact used in minfo datacage." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.BedHeightsArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="staticsqrelation" description="Factory to create an artifact that generates sq relations from db." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.D4EArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="sqrelationdatacage" description="Factory to create an artifact that generates sq relations from db." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.SQRelationArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="morph-width" description="Factory to create an artifact used in minfo datacage." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.StaticMorphWidthArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - - <artifact-factory name="gaugedischargecurve" description="Factory to create an artifact to show a discharge curve for a gauge." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.D4EArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="flowvelocitymodel" description="Factory to create an artifact to show measured flow velocities." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.FlowVelocityModelArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="flowvelocity" description="Factory to create an artifact to show measured flow velocities." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.FlowVelocityMeasurementArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="sedimentdensity" description="Factory to create an artifact to show Sediment Density values." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.SedimentDensityArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="sedimentload" description="Factory to create an artifact to show Sedimentload values." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.D4EArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="sedimentload_ls" description="Factory to create an artifact to show values from the sedimentload_ls table." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.D4EArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <artifact-factory name="porosity" description="Factory to create an artifact to show porosity values." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.D4EArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - - <!-- SINFO specific Artifacts --> - <artifact-factory name="sinfo" description="Factory to create an artifact to be used in module sinfo." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.sinfo.SINFOArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - <!-- UINFO specific Artifacts --> - <artifact-factory name="uinfo" description="Factory to create an artifact to be used in module uinfo." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.uinfo.UINFOArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - - <artifact-factory name="tkhxf" description="Factory to create an artifact used in sinfo datacage." - ttl="3600000" - artifact="org.dive4elements.river.artifacts.sinfo.predefinedtkh.PredefinedTkhArtifact">org.dive4elements.artifactdatabase.DefaultArtifactFactory</artifact-factory> - - </artifact-factories> - - <user-factory name="default" description="Factory to create new users">org.dive4elements.artifactdatabase.DefaultUserFactory</user-factory> - - <service-factories> - <service-factory - name="server-info" - service="org.dive4elements.river.artifacts.services.ServerInfoService" - description="This service provides generic information and configuration of the artifact server.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="rivers" - service="org.dive4elements.river.artifacts.services.RiverService" - description="This service returns a list of provided rivers by the artifact server.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="distanceinfo" - service="org.dive4elements.river.artifacts.services.DistanceInfoService" - description="Returns a list of distances supported by a specific river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="mainvalues" - service="org.dive4elements.river.artifacts.services.MainValuesService" - description="Returns the main values of a river's gauge based on a start and end point of the river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="metadata" - service="org.dive4elements.river.artifacts.services.MetaDataService" - description="The service provides some introspection into the database content.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="mapinfo" - service="org.dive4elements.river.artifacts.services.MapInfoService" - description="The service provides some basic information to create a WMS for a specific river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="cross-section-km" - service="org.dive4elements.river.artifacts.services.CrossSectionKMService" - description="The service provides the N next neighbored kms and ids of cross section lines for given cross section id, km and N.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="cache-invalidation" - service="org.dive4elements.river.artifacts.services.CacheInvalidationService" - description="The service invalidates caches.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="dischargeinfo" - service="org.dive4elements.river.artifacts.services.DischargeInfoService" - description="Returns description, start year and end year of discharges at a specific gauge.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="fixings-overview" - service="org.dive4elements.river.artifacts.services.FixingsOverviewService" - description="Returns an overview of the fixings of a given river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="fixings-km-chart" - service="org.dive4elements.river.artifacts.services.FixingsKMChartService" - description="Returns a chart of fixings of given river and km.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="gaugeinfo" - service="org.dive4elements.river.artifacts.services.GaugeInfoService" - description="Returns an overview of the fixings of a given river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="fileupload" - service="org.dive4elements.river.artifacts.services.FileUploadService" - description="Takes base64 coded files embedded in XML.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="themelisting" - service="org.dive4elements.river.artifacts.services.ThemeListingService" - description="Returns a list of Themes filtered by theme name.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="sq-km-chart" - service="org.dive4elements.river.artifacts.services.SQKMChartService" - description="Returns a chart of km and date of meassuring points of a given river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="modules" - service="org.dive4elements.river.artifacts.services.ModuleService" - description="Returns a list of available modules.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="bed-km-chart" - service="org.dive4elements.river.artifacts.services.BedKMChartService" - description="Returns a chart of km and date of meassuring points of a given river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="bedload-km-chart" - service="org.dive4elements.river.artifacts.services.BedloadKMChartService" - description="Returns a chart of km and date of meassuring points of a given river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="gaugeoverviewinfo" - service="org.dive4elements.river.artifacts.services.GaugeOverviewInfoService" - description="Returns an overview of the fixings of a given river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="dischargetablesoverview" - service="org.dive4elements.river.artifacts.services.DischargeTablesOverview" - description="Returns an overview of the fixings of a given river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="measurementstationinfo" - service="org.dive4elements.river.artifacts.services.MeasurementStationInfoService" - description="Returns an overview of the measurement stations of a given river.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - <service-factory - name="sedimentloadinfo" - service="org.dive4elements.river.artifacts.services.SedimentLoadInfoService" - description="Returns sedimentloads.">org.dive4elements.artifactdatabase.DefaultServiceFactory</service-factory> - </service-factories> - - </factories> - - <lifetime-listeners> - <listener>org.dive4elements.river.artifacts.datacage.Datacage</listener> - <listener>org.dive4elements.river.wsplgen.SchedulerSetup</listener> - <listener>org.dive4elements.river.artifacts.map.RiverMapfileGeneratorStarter</listener> - </lifetime-listeners> - - <backend-listeners> - <listener>org.dive4elements.river.artifacts.datacage.DatacageBackendListener</listener> - </backend-listeners> - - <callcontext-listener - name="SessionCallContextListener" - description="A CallContext.Listener to open and close Hibernatesessions">org.dive4elements.river.artifacts.context.SessionCallContextListener</callcontext-listener> - - <artifacts> - <artifact name="manualpoints" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/manualpoints.xml" /> - <artifact name="winfo" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/winfo.xml" /> - <artifact name="minfo" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/minfo.xml" /> - <artifact name="waterlevel" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/waterlevel.xml" /> - <artifact name="annotation" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/annotation.xml" /> - <artifact name="hyk" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/hyk.xml" /> - <artifact name="wmsbackground" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/wmsbackground.xml" /> - <artifact name="new_map" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/map.xml" /> - <artifact name="new_chart" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/chart.xml" /> - <artifact name="staticwqkms" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/staticwqkms.xml" /> - <artifact name="fixanalysis" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/fixanalysis.xml" /> - <artifact name="gaugedischarge" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/gaugedischarge.xml" /> - <artifact name="qsector" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/qsector.xml" /> - &sqrelation-artifact; - &sqrelation-datacage-artifact; - &porosity-artifact; - &gaugedischargecurve-artifact; - &sedimentload-artifact; - &sedimentload-ls-artifact; - - &sinfo_artifact; - &uinfo_artifact; - </artifacts> - - &modules; - - <hooks> - <hook - class="org.dive4elements.river.artifacts.CollectionMonitor" - applies="post-feed,post-advance,post-describe" - xmlns:xlink="http://www.w3.org/1999/xlink" - xlink:href="${artifacts.config.dir}/output-defaults.xml"> - </hook> - </hooks> - - &generators; - - <!-- Path to the template file of the meta data. --> - <metadata> - <template>${artifacts.config.dir}/meta-data.xml</template> - </metadata> - - &floodmap; - &rivermap; - - &rest-server; - - <!-- Garbage collection of outdated artifacts. --> - <cleaner> - <sleep-time>60000</sleep-time> - </cleaner> - - <cache> - <config-file>${artifacts.config.dir}/cache.xml</config-file> - </cache> - - <!-- Configuration of used databases. --> - &artifact-db; - &datacage-db; - &backend-db; - &seddb-db; - - <flys> - <themes> - <configuration>${artifacts.config.dir}/themes.xml</configuration> - </themes> - </flys> - - <options> - &zoom-scales; - - <dgm-path>/opt/d4e-river/dgm/</dgm-path> - - <sediment-density-factor>1.9</sediment-density-factor> - </options> - - <!-- base url for online help. --> - <help-url>http://example.com</help-url> -</artifact-database>
--- a/artifacts/doc/conf/seddb-db.xml Wed Apr 25 11:58:49 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<seddb-database> - <!-- This is the default SedDB db configuration. --> - <user>seddb</user> - <password>seddb</password> - <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect> - <driver>org.postgresql.Driver</driver> - <url>jdbc:postgresql://localhost:5432/seddb</url> - <validation-query>select 1 from gewaesser</validation-query> - <max-wait>30000</max-wait> - <!-- - <connection-init-sqls>ALTER SESSION SET CURRENT_SCHEMA=SEDDB</connection-init-sqls> - --> -</seddb-database>
--- a/backend/contrib/run_geo.sh Wed Apr 25 11:58:49 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -#!/bin/bash - -# Set this to your target database for Oracle -HOST=localhost -BACKEND_NAME="XE" -USER=flys28 -PASS=flys28 -# Alternatively you can provide a direct connection string: -# OGR_CONNECTION="PG:dbname=flys host=localhost port=5432 user=flys password=flys" - -# Optional -VERBOSE=1 -SKIP_AXIS=0 -SKIP_KMS=0 -SKIP_CROSSSECTIONS=0 -SKIP_FIXPOINTS=0 -SKIP_BUILDINGS=0 -SKIP_FLOODPLAINS=0 -SKIP_HYDR_BOUNDARIES=0 -SKIP_HWS_LINES=0 -SKIP_HWS_POINTS=0 -SKIP_UESG=0 -SKIP_DGM=0 -SKIP_JETTIES=0 -SKIP_FLOODMARKS=0 - -# Default encoding. Change here if necessary -export LC_ALL=de_DE@euro - -# There should be no need to change anything below this line -GEW_FILE="$1" -RIVER_NAME=$(grep "Gew.sser" "$1" | sed 's/Gew.sser: //') - -RIVER_PATH=$(grep "WSTDatei:" "$GEW_FILE" | awk '{print $2}') -RIVER_PATH=$(dirname "$RIVER_PATH")/../.. -RIVER_PATH=$(readlink -f "$RIVER_PATH") - -DIR=`dirname $0` -DIR=`readlink -f "$DIR"` - -exec python $DIR/shpimporter/shpimporter.py \ - --directory $RIVER_PATH \ - --river_name "$RIVER_NAME" \ - --ogr_connection "$OGR_CONNECTION" \ - --host $HOST/$BACKEND_NAME \ - --user $USER \ - --password $PASS \ - --verbose $VERBOSE \ - --skip_axis $SKIP_AXIS \ - --skip_kms $SKIP_KMS \ - --skip_crosssections $SKIP_CROSSSECTIONS \ - --skip_fixpoints $SKIP_FIXPOINTS \ - --skip_buildings $SKIP_BUILDINGS \ - --skip_floodplains $SKIP_FLOODPLAINS \ - --skip_hydr_boundaries $SKIP_HYDR_BOUNDARIES \ - --skip_uesgs $SKIP_UESG \ - --skip_hws_lines $SKIP_HWS_LINES \ - --skip_hws_points $SKIP_HWS_POINTS \ - --skip_dgm $SKIP_DGM \ - --skip_jetties $SKIP_JETTIES \ - --skip_floodmarks $SKIP_FLOODMARKS \ - 2>&1
--- a/backend/doc/schema/Dockerfile Wed Apr 25 11:58:49 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -# Docker file for postgresql 9.4 on debain -# -# build with e.g. `docker build --force-rm=true -t d4e/river_db .', -# then run with e.g. -# `docker run --name d4eriver_db -dp 2345:5432 d4e/river_db:latest' -# - -FROM debian:jessie -MAINTAINER tom@intevation.de - -# -# Use utf-8 -# -RUN echo \ - "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | \ - debconf-set-selections && \ - echo "locales locales/default_environment_locale select en_US.UTF-8" | \ - debconf-set-selections - -RUN apt-get update -y && apt-get install -y locales - -ENV LC_ALL en_US.UTF-8 - -# -# Install packages -# -RUN apt-get update && \ - apt-get install -y postgresql-9.4-postgis-2.1 postgis curl - -# -# Use user postgres to run the next commands -# -USER postgres - -RUN /etc/init.d/postgresql start && \ - psql --command "CREATE USER admin WITH SUPERUSER PASSWORD 'secret';" - -# -# Adjust PostgreSQL configuration so that remote connections to the -# database are possible. -# -RUN echo "host all all 0.0.0.0/0 md5" >> \ - /etc/postgresql/9.4/main/pg_hba.conf - -ENV PGCONF /etc/postgresql/9.4/main/postgresql.conf -RUN echo "listen_addresses='*'" >> $PGCONF - -# -# Expose the PostgreSQL port -# -EXPOSE 5432 - -# -# Create database -# -# Don't mind scary messages like -# 'FATAL: the database system is starting up'. -# It's because of the -w -# -ADD . /opt/d4eriver_db - -# Go to postgres home for write permissions -WORKDIR /var/lib/postgresql -ENV DATA_ARCH demodaten_3.1.10-bis-3.2.x.tar.gz -RUN curl -k "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \ - tar xz - -ENV PGDATA /var/lib/postgresql/9.4/main -RUN /usr/lib/postgresql/9.4/bin/pg_ctl start -wo "--config_file=$PGCONF" && \ - /opt/d4eriver_db/postgresql-setup.sh && \ - psql -f demodaten/d4e_demodata.dump.sql d4e && \ - createuser -S -D -R seddb && \ - createdb seddb && \ - psql -f demodaten/seddb_demodata.dump.sql seddb && \ - /usr/lib/postgresql/9.4/bin/pg_ctl stop - -# -# Set the default command to run when starting the container -# -CMD ["/usr/lib/postgresql/9.4/bin/postgres", "-D", \ - "/var/lib/postgresql/9.4/main", "-c", \ - "config_file=/etc/postgresql/9.4/main/postgresql.conf"]
--- a/backend/src/main/java/org/dive4elements/river/backend/SedDBCredentials.java Wed Apr 25 11:58:49 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde - * Software engineering by Intevation GmbH - * - * This file is Free Software under the GNU AGPL (>=v3) - * and comes with ABSOLUTELY NO WARRANTY! Check out the - * documentation coming with Dive4Elements River for details. - */ - -package org.dive4elements.river.backend; - -import org.dive4elements.artifacts.common.utils.Config; - - -public class SedDBCredentials -extends Credentials -{ - public static final String XPATH_USER = - "/artifact-database/seddb-database/user/text()"; - - public static final String XPATH_PASSWORD = - "/artifact-database/seddb-database/password/text()"; - - public static final String XPATH_DIALECT = - "/artifact-database/seddb-database/dialect/text()"; - - public static final String XPATH_DRIVER = - "/artifact-database/seddb-database/driver/text()"; - - public static final String XPATH_URL = - "/artifact-database/seddb-database/url/text()"; - - public static final String XPATH_CONNECTION_INIT_SQLS = - "/artifact-database/seddb-database/connection-init-sqls/text()"; - - public static final String XPATH_VALIDATION_QUERY = - "/artifact-database/seddb-database/validation-query/text()"; - - public static final String XPATH_MAX_WAIT = - "/artifact-database/seddb-database/max-wait/text()"; - - public static final String DEFAULT_USER = - System.getProperty("flys.seddb.user", "seddb"); - - public static final String DEFAULT_PASSWORD = - System.getProperty("flys.seddb.password", "seddb"); - - public static final String DEFAULT_DIALECT = - System.getProperty( - "flys.seddb.dialect", - "org.hibernate.dialect.PostgreSQLDialect"); - - public static final String DEFAULT_DRIVER = - System.getProperty( - "flys.seddb.driver", - "org.postgresql.Driver"); - - public static final String DEFAULT_URL = - System.getProperty( - "flys.seddb.url", - "jdbc:postgresql://localhost:5432/seddb"); - - public static final String DEFAULT_CONNECTION_INIT_SQLS = - System.getProperty( - "flys.seddb.connection.init.sqls"); - - public static final String DEFAULT_VALIDATION_QUERY = - System.getProperty( - "flys.seddb.connection.validation.query"); - - public static final String DEFAULT_MAX_WAIT = - System.getProperty("flys.seddb.connection.max.wait"); - - public static final Class [] CLASSES = {}; - - private static Credentials instance; - - public SedDBCredentials() { - } - - public SedDBCredentials( - String user, - String password, - String dialect, - String driver, - String url, - String connectionInitSqls, - String validationQuery, - String maxWait - ) { - super( - user, password, dialect, driver, url, - connectionInitSqls, validationQuery, maxWait, CLASSES); - } - - public static synchronized Credentials getInstance() { - if (instance == null) { - String user = - Config.getStringXPath(XPATH_USER, DEFAULT_USER); - String password = - Config.getStringXPath(XPATH_PASSWORD, DEFAULT_PASSWORD); - String dialect = - Config.getStringXPath(XPATH_DIALECT, DEFAULT_DIALECT); - String driver = - Config.getStringXPath(XPATH_DRIVER, DEFAULT_DRIVER); - String url = - Config.getStringXPath(XPATH_URL, DEFAULT_URL); - String connectionInitSqls = - Config.getStringXPath( - XPATH_CONNECTION_INIT_SQLS, - DEFAULT_CONNECTION_INIT_SQLS); - String validationQuery = - Config.getStringXPath( - XPATH_VALIDATION_QUERY, - DEFAULT_VALIDATION_QUERY); - String maxWait = - Config.getStringXPath(XPATH_MAX_WAIT, DEFAULT_MAX_WAIT); - - instance = new SedDBCredentials( - user, password, dialect, driver, url, - connectionInitSqls, validationQuery, maxWait); - } - return instance; - } - - public static Credentials getDefault() { - return new SedDBCredentials( - DEFAULT_USER, - DEFAULT_PASSWORD, - DEFAULT_DIALECT, - DEFAULT_DRIVER, - DEFAULT_URL, - DEFAULT_CONNECTION_INIT_SQLS, - DEFAULT_VALIDATION_QUERY, - DEFAULT_MAX_WAIT - ); - } -} -// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/etl/doc/conf.xml Wed Apr 25 11:58:49 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sync> - <!-- If modified send messages --> - <notifications> - <notifaction url="http://example.com"> - <caches> - <cache name="my-cache"/> - </caches> - </notifaction> - </notifications> - <!-- The path to the DiPs file --> - <dips> - <file>/the/path/to/the/dips/file</file> - <repair>/the/path/to/the/xslt/to/repair/dips</repair> - </dips> - <!-- The FLYS side --> - <side name="flys"> - <db> - <driver>org.postgresql.Driver</driver> - <user>flys</user> - <password>flys</password> - <url>jdbc:postgresql://localhost:5432/flys</url> - </db> - </side> - <!-- The AFT side --> - <side name="aft"> - <db> - <driver>org.sqlite.JDBC</driver> - <user/> - <password/> - <url>jdbc:sqlite:/path/to/aft.db</url> - <!-- - <execute-login> - <statement>ALTER SESSION SET CURRENT_SCHEMA=AFT</statement> - </execute-login> - --> - </db> - </side> -</sync>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RecommandationUtils.java Thu Apr 26 10:46:12 2018 +0200 @@ -0,0 +1,58 @@ +/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde + * Software engineering by + * Björnsen Beratende Ingenieure GmbH + * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ +package org.dive4elements.river.client.client.ui; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.dive4elements.river.client.client.ui.AbstractPairRecommendationPanel.IRecommendationInfo; +import org.dive4elements.river.client.shared.model.Recommendation; +import org.dive4elements.river.client.shared.model.Recommendation.Facet; +import org.dive4elements.river.client.shared.model.Recommendation.Filter; + +/** + * @author Domenico Nardi Tironi + * + */ +public class RecommandationUtils { + /** + * Creates part of the String that encodes minuend or subtrahend. + * + * @param recommendation + * Recommendation to wrap in string. + * @param info + * Provides the factory to encode. + */ + public static final String createDataString(final String artifactUuid, final Recommendation recommendation, final IRecommendationInfo info) { + final String factory = info.getDataStringFactory(recommendation); + + final Filter filter = recommendation.getFilter(); + Facet f = null; + + if (filter != null) { + final Map<String, List<Facet>> outs = filter.getOuts(); + final Set<Map.Entry<String, List<Facet>>> entries = outs.entrySet(); + + for (final Map.Entry<String, List<Facet>> entry : entries) { + final List<Facet> fs = entry.getValue(); + + f = fs.get(0); + if (f != null) { + break; + } + } + + return "[" + artifactUuid + ";" + f.getName() + ";" + f.getIndex() + ";" + recommendation.getDisplayName() + "]"; + } + + return "[" + artifactUuid + ";" + factory + ";0;" + recommendation.getDisplayName() + "]"; + } +}
--- a/gwt-client/src/main/java/org/dive4elements/river/client/test/SinfoProof.java Wed Apr 25 11:58:49 2018 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/test/SinfoProof.java Thu Apr 26 10:46:12 2018 +0200 @@ -9,27 +9,30 @@ package org.dive4elements.river.client.test; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; -import java.net.MalformedURLException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; -import org.apache.log4j.Logger; -import org.apache.log4j.PropertyConfigurator; import org.dive4elements.artifacts.common.ArtifactNamespaceContext; import org.dive4elements.artifacts.common.utils.ClientProtocolUtils; import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; import org.dive4elements.artifacts.httpclient.http.HttpClient; import org.dive4elements.artifacts.httpclient.http.HttpClientImpl; import org.dive4elements.artifacts.httpclient.http.response.DocumentResponseHandler; -import org.dive4elements.artifacts.httpclient.utils.Configuration; import org.dive4elements.artifacts.httpclient.utils.XMLUtils; +import org.dive4elements.river.client.client.ui.NilDatacageTwinPanelInfo; +import org.dive4elements.river.client.client.ui.RecommandationUtils; import org.dive4elements.river.client.server.AdvanceServiceImpl; import org.dive4elements.river.client.server.ArtifactHelper; import org.dive4elements.river.client.server.CollectionHelper; import org.dive4elements.river.client.server.CreateCollectionServiceImpl; import org.dive4elements.river.client.server.FLYSArtifactCreator; import org.dive4elements.river.client.server.FeedServiceImpl; +import org.dive4elements.river.client.server.LoadArtifactServiceImpl; import org.dive4elements.river.client.server.auth.DefaultUser; import org.dive4elements.river.client.server.auth.User; import org.dive4elements.river.client.server.auth.UserClient; @@ -51,78 +54,12 @@ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class SinfoProof { - /** - * The logging is done via Log4j. To configure the logging - * a file 'log4j.properties' is search in the configuration directory. - */ - public static final String LOG4J_PROPERTIES = "log4j.properties"; - /** - * The path of the configuration directory. - */ - public static final String CONFIG_PATH = System.getProperty("config.dir", "conf"); - - public static final String CONFIG = System.getProperty("config.file", "use_case1.conf"); - - public static final String XPATH_DYNAMIC = "/art:result/art:ui/art:dynamic"; private static final String serverUrl = "http://localhost:8181"; private static final String locale = "de"; - /** - * The logger used in this class. - */ - private static Logger logger; - - static { - configureLogging(); - - logger = Logger.getLogger(SinfoProof.class); - } - - /** - * Trys to load the Log4j configuration from ${config.dir}/log4j.properties. - */ - public static final void configureLogging() { - final File configDir = new File(CONFIG_PATH); - final File propFile = new File(configDir, LOG4J_PROPERTIES); - - if (propFile.isFile() && propFile.canRead()) { - try { - PropertyConfigurator.configure(propFile.toURI().toURL()); - } - catch (final MalformedURLException mue) { - mue.printStackTrace(System.err); - } - } - } - - public static final Configuration readConfiguration() { - final File configDir = new File(CONFIG_PATH); - final File configFile = new File(configDir, CONFIG); - - logger.debug("Configuration file: " + configFile.getAbsolutePath()); - - if (configFile.isFile() && configFile.canRead()) { - try { - final Configuration conf = new Configuration(configFile); - conf.initialize(); - - return conf; - } - catch (final IOException ioe) { - logger.error("Error while reading configuration."); - } - } - - return null; - } - - public SinfoProof() { - // empty constructor - super(); - } public static void main(final String[] args) throws ServerException, IOException { - logger.info("Starting console client."); + // logger.info("Starting console client."); final User user = new DefaultUser("belger", "belger", null, false, new ArrayList<String>(), new ArrayList<String>()); final UserClient userClient = new UserClient(serverUrl); @@ -144,33 +81,58 @@ final Data dataCalcMode = new StringOptionsData("calculation_mode", "calculation_mode", new DataItem[] { minMaxFlowdepth }); final Artifact rangeArtifact = feedAndGo(calcModeArtifact, new Data[] { dataCalcMode }, 0); - /* Select Distance */ + /* Select Range */ // entweder eine bestimmte Range - final Data dataFrom = new StringOptionsData("ld_from", "ld_from", new DataItem[] { new DefaultDataItem("0", "0", "0") }); + final Data dataFrom = new StringOptionsData("ld_from", "ld_from", new DataItem[] { new DefaultDataItem("10", "10", "10") }); final Data dataTo = new StringOptionsData("ld_to", "ld_to", new DataItem[] { new DefaultDataItem("100", "100", "100") }); final Data[] rangeFromToDetermined = new Data[] { dataFrom, dataTo }; // oder die maxRange final DataList list = rangeArtifact.getArtifactDescription().getCurrentData(); final Data[] rangeMax = new Data[] { list.get(0), list.get(1) }; - final Artifact dataChoiceArtifact = feedAndGo(rangeArtifact, rangeMax, 0); + + final Artifact dataChoiceArtifact = feedAndGo(rangeArtifact, rangeFromToDetermined, 0); /* Select Fixpunkte */ - final List<Recommendation> recs = collection.getRecommendations(); - if (recs != null) { + final Recommendation rec1 = new Recommendation("staticwqkms", "additionals-wstv-0-103", "sinfo_flowdepth_waterlevels"); + final Recommendation rec2 = new Recommendation("bedheight", "bedheight-single-36-2015-FP-2015_0-502", "sinfo_flowdepthminmax_heights"); + final Artifact[] artifacts = loadMany(collection, new Recommendation[] { rec1, rec2 }, null); + + // rec1.getDisplayName() TODO: makeDisplayName + final String rec1String = RecommandationUtils.createDataString(artifacts[0].getUuid(), rec1, new NilDatacageTwinPanelInfo("xxxx")); + final String rec2String = RecommandationUtils.createDataString(artifacts[1].getUuid(), rec2, new NilDatacageTwinPanelInfo("xxxx")); + // TODO: check display name + final String combinedIdNeu = rec1String + "#" + rec2String; + + final Data pair = new StringOptionsData("diffids", "diffids", new DataItem[] { new DefaultDataItem(combinedIdNeu, combinedIdNeu, combinedIdNeu) }); + final Artifact exportArtifact = feedAndGo(dataChoiceArtifact, new Data[] { pair }, 0); + + // Describe collection + describeCollection(collection); // wichtig, damit die Facets erzeugt werden + + // /* Export calculation */ + final OutputMode[] modes = exportArtifact.getArtifactDescription().getOutputModes(); + if (modes != null) { + final OutputMode mode = modes[1]; // output.sinfo_flowdepthminmax_export + doGet(mode.getName(), collection.identifier()); } - final String combinedId = "[c23bcc26-2282-47b7-b262-5a328a372926;staticwqkms;0;ELBE_W-MNQ1890-2006_Fixierungsdaten_150-280.csv]#[d2e2e1da-81cd-40e6-8857-dddc22252c29;bedheight;0;FP-2015_0-502]"; // SCHWACHSTELLE... - final Data pair = new StringOptionsData("Ausgewählte Differenzen", "diffids", new DataItem[] { new DefaultDataItem(null, null, combinedId) }); - final Artifact export = feedAndGo(dataChoiceArtifact, new Data[] { pair }, 0); - final Recommendation r; + } - /* Export calculation */ - final OutputMode[] modes = export.getArtifactDescription().getOutputModes(); - if (modes != null) { + private static Collection describeCollection(final Collection collection) throws ConnectionException { - } + final String uuid = collection.identifier(); + + final Document describe = ClientProtocolUtils.newDescribeCollectionDocument(uuid); + + final HttpClient client = new HttpClientImpl(serverUrl, locale); + + final Document response = (Document) client.doCollectionAction(describe, uuid, new DocumentResponseHandler()); + + final Collection c = CollectionHelper.parseCollection(response); + + return c; } private static Artifact feedAndGo(final Artifact inputArtifact, final Data[] data, final int reachableStateIndex) @@ -263,6 +225,75 @@ throw new ServerException(AdvanceServiceImpl.ERROR_ADVANCE_ARTIFACT); } - // FIXME + public static Artifact[] loadMany(final Collection parent, final Recommendation[] recoms, final String factory) throws ServerException { + + final ArrayList<Artifact> artifacts = new ArrayList<Artifact>(); + final HashMap<Recommendation, Artifact> cloneMap = new HashMap<Recommendation, Artifact>(); + + for (final Recommendation recom : recoms) { + + final Artifact prevClone = cloneMap.get(recom); + if (prevClone != null) { + + artifacts.add(prevClone); + } else { + // Not already cloned. + final String realFactory = factory != null ? factory : recom.getFactory(); + + final Artifact clone = ArtifactHelper.createArtifact(serverUrl, locale, realFactory, recom); + + if (clone != null) { + final Collection c = CollectionHelper.addArtifact(parent, clone, serverUrl, locale); + + if (c != null) { + artifacts.add(clone); + // Remember we cloned a recommendation like this. + cloneMap.put(recom, clone); + } else { + throw new ServerException(LoadArtifactServiceImpl.ERROR_LOAD_ARTIFACT); + } + } + } + } + return artifacts.toArray(new Artifact[artifacts.size()]); + } + + /// ExportServiceImpl + + public static void doGet(final String mode, final String collectionId) { + + try { + + final String name = mode; + final String type = "csv"; + + final String fn = name + "." + type; // TODO: make filename unique + final String enc = "windows-1252";// req.getParameter("encoding"); + + final OutputStream out = new FileOutputStream(new File("D:" + File.separator + fn)); + final Document attr = null; + final Document request = ClientProtocolUtils.newOutCollectionDocument(collectionId, mode, type, attr); + final HttpClient client = new HttpClientImpl(serverUrl, locale); + + if (enc != null) { + final InputStreamReader in = new InputStreamReader(client.collectionOut(request, collectionId, mode), "UTF-8"); + try { + final OutputStreamWriter encOut = new OutputStreamWriter(out, enc); + final char buf[] = new char[4096]; + int c; + while ((c = in.read(buf, 0, buf.length)) >= 0) { + encOut.write(buf, 0, c); + } + encOut.flush(); + encOut.close(); + } finally { + in.close(); + } + } + } + catch (final IOException ioe) { + ioe.printStackTrace(); + } + } + } -// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: