Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java @ 8313:e3a63d9c5bb1
Updated the client to build a default artifact for sq relations.
* Removed code for special sq relation artifact
* Updated MeasurementListGrid in info panel to create a new project
* Updated i18n
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 24 Sep 2014 12:02:05 +0200 |
parents | 519023ce3500 |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8312:9f5059f4f01a | 8313:e3a63d9c5bb1 |
---|---|
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 public void newSQRelation(String river, int measurementStation) { | |
500 Config config = Config.getInstance(); | |
501 | |
502 final String locale = config.getLocale(); | |
503 final String riv = river; | |
504 final int mStation = measurementStation; | |
505 final FLYS flys = this; | |
506 | |
507 User user = getCurrentUser(); | |
508 | |
509 if (user == null) { | |
510 SC.warn(MSG.error_not_logged_in()); | |
511 return; | |
512 } | |
513 | |
514 collectionService.create(locale, user.identifier(), | |
515 new AsyncCallback<Collection>() { | |
516 @Override | |
517 public void onFailure(Throwable caught) { | |
518 GWT.log("Could not create new collection."); | |
519 SC.warn(getExceptionString(MSG, caught)); | |
520 } | |
521 | |
522 @Override | |
523 public void onSuccess(Collection collection) { | |
524 GWT.log("Successfully created a new collection."); | |
525 final Collection col = collection; | |
526 artifactService.createSQRelationArtifact( | |
527 col, locale, riv, mStation, | |
528 new AsyncCallback<Artifact>() { | |
529 @Override | |
530 public void onFailure(Throwable caught) { | |
531 GWT.log("Could not create the new artifact."); | |
532 SC.warn(getExceptionString(MSG, caught)); | |
533 } | |
534 | |
535 @Override | |
536 public void onSuccess(Artifact artifact) { | |
537 GWT.log("Successfully created a new artifact."); | |
538 CollectionView view = new CollectionView(flys, | |
539 col, artifact); | |
540 workspace.addView(col.identifier(), view); | |
541 | |
542 view.addCollectionChangeHandler(getProjectList()); | |
543 view.addCloseClickHandler( | |
544 new CloseCollectionViewHandler( | |
545 FLYS.this, col.identifier())); | |
546 projectList.updateUserCollections(); | |
547 } | |
548 }); | |
549 } | |
550 }); | |
551 } | |
552 | |
553 @Override | 499 @Override |
554 public void onCollectionChange(CollectionChangeEvent event) { | 500 public void onCollectionChange(CollectionChangeEvent event) { |
555 Collection oldC = event.getOldValue(); | 501 Collection oldC = event.getOldValue(); |
556 | 502 |
557 if (oldC == null) { | 503 if (oldC == null) { |