comparison gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java @ 8303:519023ce3500

Updated the client to build a default artifact for gauge discharge curve. * Removed code for special gauge discharge artifact * Updated GaugeListGrid in info panel to create a the new project * Updated i18n
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 22 Sep 2014 17:08:48 +0200
parents d19a0ffb9ccf
children e3a63d9c5bb1
comparison
equal deleted inserted replaced
8302:8578babdb2c8 8303:519023ce3500
494 mainValueView.setTitle(MSG.mainvalues() + " " + gauge.getName() + " (" + gauge.getRiverName() + ")" ); 494 mainValueView.setTitle(MSG.mainvalues() + " " + gauge.getName() + " (" + gauge.getRiverName() + ")" );
495 workspace.addChild(mainValueView); 495 workspace.addChild(mainValueView);
496 } 496 }
497 497
498 498
499 /** Open window with gauges discharge curve. */
500 public void newGaugeDischargeCurve(String river, Long gaugeref) {
501 Config config = Config.getInstance();
502
503 final String locale = config.getLocale();
504 final String riv = river;
505 final Long ref = gaugeref;
506 final FLYS flys = this;
507
508 User user = getCurrentUser();
509
510 if (user == null) {
511 SC.warn(MSG.error_not_logged_in());
512 return;
513 }
514
515 // TODO 1081, this collection needs to be added a mainvalue artifact
516 collectionService.create(locale, user.identifier(),
517 new AsyncCallback<Collection>() {
518 @Override
519 public void onFailure(Throwable caught) {
520 GWT.log("Could not create new collection.");
521 SC.warn(getExceptionString(MSG, caught));
522 }
523
524 @Override
525 public void onSuccess(Collection collection) {
526 GWT.log("Successfully created a new collection.");
527 final Collection col = collection;
528 artifactService.createGaugeDischargeCurveArtifact(
529 col, locale, riv, ref,
530 new AsyncCallback<Artifact>() {
531 @Override
532 public void onFailure(Throwable caught) {
533 GWT.log("Could not create the new artifact.");
534 SC.warn(getExceptionString(MSG, caught));
535 }
536
537 @Override
538 public void onSuccess(Artifact artifact) {
539 GWT.log("Successfully created a new artifact.");
540 CollectionView view = new CollectionView(flys,
541 col, artifact);
542 workspace.addView(col.identifier(), view);
543
544 view.addCollectionChangeHandler(getProjectList());
545 view.addCloseClickHandler(
546 new CloseCollectionViewHandler(
547 FLYS.this, col.identifier()));
548 projectList.updateUserCollections();
549 }
550 });
551 }
552 });
553 }
554
555 public void newSQRelation(String river, int measurementStation) { 499 public void newSQRelation(String river, int measurementStation) {
556 Config config = Config.getInstance(); 500 Config config = Config.getInstance();
557 501
558 final String locale = config.getLocale(); 502 final String locale = config.getLocale();
559 final String riv = river; 503 final String riv = river;

http://dive4elements.wald.intevation.org