# HG changeset patch # User Ingo Weinzierl # Date 1318228715 0 # Node ID 94d4f040da3a620769ab66ab01915ebd1934fca0 # Parent e88cd17b34207a3ae74bcdb3503e3e53827eef59 Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set. flys-client/trunk@2909 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r e88cd17b3420 -r 94d4f040da3a flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Fri Oct 07 13:39:35 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Mon Oct 10 06:38:35 2011 +0000 @@ -346,6 +346,22 @@ public void onSuccess(Collection c) { final Collection collection = c; + + if (collection.getItemLength() == 0) { + CollectionView view = new CollectionView( + FLYS.this, collection, null); + + view.addCollectionChangeHandler( + getProjectList()); + view.addCloseClickHandler( + new CloseCollectionViewHandler( + FLYS.this, collectionID)); + + workspace.addView(collectionID, view); + + return; + } + final CollectionItem item = c.getItem(0); if (item == null) { diff -r e88cd17b3420 -r 94d4f040da3a flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java Fri Oct 07 13:39:35 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java Mon Oct 10 06:38:35 2011 +0000 @@ -156,11 +156,19 @@ this.handlers = new ArrayList(); this.outHandlers = new ArrayList(); this.layout = new VLayout(); - this.parameterList = new ParameterList( - flys, - this, - messages.getString(artifact.getName()), - artifact); + + if (artifact != null) { + this.parameterList = new ParameterList( + flys, + this, + messages.getString(artifact.getName()), + artifact); + } + else { + this.parameterList = new ParameterList( + flys, this, messages.new_project()); + } + this.artifactsQueue = 0; this.newRecommendations = new Stack(); @@ -176,7 +184,10 @@ init(); setCollection(collection); - setArtifact(artifact); + + if (artifact != null) { + setArtifact(artifact); + } }