comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java @ 4696:03c66281c16b

Rename methods and mark them private
author Björn Ricks <bjoern.ricks@intevation.de>
date Mon, 17 Dec 2012 16:17:53 +0100
parents 139cf1f9a22c
children 2c31625d4e6a
comparison
equal deleted inserted replaced
4695:139cf1f9a22c 4696:03c66281c16b
841 } 841 }
842 842
843 @Override 843 @Override
844 public void onSuccess(Artifact artifact) { 844 public void onSuccess(Artifact artifact) {
845 GWT.log("Created new artifact: " + artifact.getUuid()); 845 GWT.log("Created new artifact: " + artifact.getUuid());
846 createCollection(artifact); 846 createClonedCollection(artifact);
847 } 847 }
848 } 848 }
849 ); 849 );
850 } 850 }
851 851
875 } 875 }
876 }); 876 });
877 } 877 }
878 878
879 879
880 protected void createCollection(final Artifact artifact) { 880 /**
881 * Creates a {@link Collection} with the passed {@link Artifact}
882 * @param artifact {@link Artifact} to add to the new {@link Collection}
883 */
884 private void createClonedCollection(final Artifact artifact) {
881 Config config = Config.getInstance(); 885 Config config = Config.getInstance();
882 final String locale = config.getLocale(); 886 final String locale = config.getLocale();
883 final String ownerid = user.identifier(); 887 final String ownerid = user.identifier();
884 888
885 createCollectionService.create( 889 createCollectionService.create(
893 } 897 }
894 898
895 @Override 899 @Override
896 public void onSuccess(Collection collection) { 900 public void onSuccess(Collection collection) {
897 GWT.log("Successfully created a new collection."); 901 GWT.log("Successfully created a new collection.");
898 addArtifactToCollection(artifact, collection); 902 addArtifactToClonedCollection(artifact, collection);
899 } 903 }
900 } 904 }
901 ); 905 );
902 } 906 }
903 907
904 908
905 protected void addArtifactToCollection(Artifact a, Collection c) { 909 private void addArtifactToClonedCollection(Artifact a, Collection c) {
906 Config config = Config.getInstance(); 910 Config config = Config.getInstance();
907 final String locale = config.getLocale(); 911 final String locale = config.getLocale();
908 912
909 addArtifactService.add( 913 addArtifactService.add(
910 c, a, locale, 914 c, a, locale,
920 String name = cloneCollection.getName(); 924 String name = cloneCollection.getName();
921 if(name == null || name.equals("")) { 925 if(name == null || name.equals("")) {
922 name = cloneCollection.identifier(); 926 name = cloneCollection.identifier();
923 } 927 }
924 928
925 newColl.setName(messages.copy_of() + ": " + name); 929 String colname = messages.copy_of() + ": " + name;
926 930
927 updateCollectionName(newColl, colname); 931 updateCollectionName(newColl, colname);
928 if(cloneCollection.getTTL() == 0) { 932 if(cloneCollection.getTTL() == 0) {
929 newColl.setTTL(0); 933 newColl.setTTL(0);
930 updateCollectionTTL(newColl); 934 updateCollectionTTL(newColl);
931 } 935 }
932 updateUserCollections();
933 } 936 }
934 } 937 }
935 ); 938 );
936 } 939 }
937 940

http://dive4elements.wald.intevation.org