annotate flys-client/src/main/java/de/intevation/flys/client/server/LoadArtifactServiceImpl.java @ 1307:489e6a82fe84

Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen). flys-client/trunk@2941 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 12 Oct 2011 06:59:42 +0000
parents 2ce5d7ac9e60
children a3c04eb326f3
rev   line source
905
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.server;
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
3 import java.util.ArrayList;
1307
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
4 import java.util.HashMap;
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
5
905
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import de.intevation.flys.client.shared.exceptions.ServerException;
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import de.intevation.flys.client.shared.model.Artifact;
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import de.intevation.flys.client.shared.model.Collection;
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import de.intevation.flys.client.shared.model.Recommendation;
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import de.intevation.flys.client.client.services.LoadArtifactService;
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 /**
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 * This service creates a new Artifact based on a given Recommendation and puts
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 * this new artifact into a specified Collection.
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 *
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 */
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 public class LoadArtifactServiceImpl
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 extends ArtifactServiceImpl
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 implements LoadArtifactService
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 {
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 public static final String ERROR_LOAD_ARTIFACT = "error_load_artifact";
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 public Artifact load(
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 Collection parent,
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 Recommendation recom,
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 String factory,
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 String url,
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 String locale
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 )
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 throws ServerException {
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 System.out.println(
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 "LoadArtifactServiceImpl.load: " + recom.getMasterArtifact());
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 // 1) Clone the Artifact specified in >>recom<<
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 Artifact clone = ArtifactHelper.createArtifact(
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 url, locale, factory, recom);
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 if (clone != null) {
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 System.out.println("Successfully create Artifact Clone. Add now!");
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 Collection c = CollectionHelper.addArtifact(
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 parent, clone, url, locale);
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 if (c != null) {
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 System.out.println("Successfully added Clone to Collection.");
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 return clone;
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 }
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 }
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 throw new ServerException(ERROR_LOAD_ARTIFACT);
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 }
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
54
1272
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
55
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
56 /**
1307
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
57 * Clone one or more artifacts and add it to a collection, avoid duplicates.
1272
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
58 *
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
59 * @param parent Collection where clones will be added to.
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
60 * @param recommendations definitions of source of clone.
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
61 * @param factory name of factory to use when cloning artifacts.
1307
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
62 * @return cloned artifacts (same artifact might be contained multiple
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
63 * times).
1272
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
64 */
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
65 public Artifact[] loadMany(
1272
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
66 Collection parent,
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
67 Recommendation[] recoms,
1272
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
68 String factory,
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
69 String url,
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
70 String locale
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
71 )
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
72 throws ServerException {
1307
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
73 System.out.println("LoadArtifactServiceImpl.loadMany");
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
74 ArrayList<Artifact> artifacts = new ArrayList<Artifact>();
1307
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
75 HashMap<Recommendation, Artifact> cloneMap =
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
76 new HashMap<Recommendation, Artifact>();
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
77
1272
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
78 // TODO Respect the index of what to clone.
2ce5d7ac9e60 Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 913
diff changeset
79
1307
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
80 // 1) Clone the Artifacts specified in >>recoms<<
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
81 for (Recommendation recom : recoms) {
1307
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
82 // Do not do two clones of two identical recommendations.
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
83 Artifact prevClone = cloneMap.get(recom);
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
84 if (prevClone != null) {
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
85 // Already cloned a recommendation like this.
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
86 System.out.println("LoadArtifactServiceImpl: Avoid reclones, "
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
87 + "clone already exists.");
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
88 artifacts.add(prevClone);
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
89 }
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
90 else {
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
91 // Not already cloned.
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
92 Artifact clone = ArtifactHelper.createArtifact(
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
93 url, locale, factory, recom);
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
94
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
95 if (clone != null) {
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
96 System.out.println("LoadArtifactServiceImple: Successfully "
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
97 + "loaded Artifact Clone.");
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
98 Collection c = CollectionHelper.addArtifact(
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
99 parent, clone, url, locale);
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
100
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
101 if (c != null) {
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
102 artifacts.add(clone);
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
103 // Remember we cloned a recommendation like this.
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
104 cloneMap.put(recom, clone);
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
105 }
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
106 else {
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
107 throw new ServerException(ERROR_LOAD_ARTIFACT);
489e6a82fe84 Partial fix for flys/issue304 (Erweiterte Funktionen W-Differenzen).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1272
diff changeset
108 }
913
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
109 }
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
110 }
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
111 }
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
112 return artifacts.toArray(new Artifact[artifacts.size()]);
9976d99aea34 Added loadMany-function to LoadArtifactService.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 905
diff changeset
113 }
905
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 }
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org