changeset 66:89e3de0ee05f

Implemented some methods to get access to ArtifactFactories which are stored in the ArtifactDatabase. artifacts/trunk@546 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 15 Jan 2010 17:39:32 +0000
parents 82f62ef25a8f
children ed03cc0e5800
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java artifacts/src/main/java/de/intevation/artifacts/CallContext.java
diffstat 4 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jan 12 08:42:49 2010 +0000
+++ b/ChangeLog	Fri Jan 15 17:39:32 2010 +0000
@@ -1,3 +1,13 @@
+2010-01-15  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	* artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java:
+	  Added a method 'getInternalArtifactFactory' to get an ArtifactFactory by
+	  its name.
+
+	* artifacts/src/main/java/de/intevation/artifacts/CallContext.java: Added
+	  'getDatabase' method to get access to the ArtifactDatabase from context.
+
 2010-01-12  Ingo Weinzierl <ingo.weinzierl@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/rest/ArtifactOutResource.java,
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java	Tue Jan 12 08:42:49 2010 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java	Fri Jan 15 17:39:32 2010 +0000
@@ -84,6 +84,10 @@
             return context;
         }
 
+        public ArtifactDatabase getDatabase() {
+            return ArtifactDatabaseImpl.this;
+        }
+
         public CallMeta getMeta() {
             return callMeta;
         }
@@ -251,6 +255,10 @@
         return factoryNamesAndDescription;
     }
 
+    public ArtifactFactory getInternalArtifactFactory(String factoryName) {
+        return getArtifactFactory(factoryName);
+    }
+
     public ArtifactFactory getArtifactFactory(String factoryName) {
         return (ArtifactFactory)name2factory.get(factoryName);
     }
--- a/artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java	Tue Jan 12 08:42:49 2010 +0000
+++ b/artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java	Fri Jan 15 17:39:32 2010 +0000
@@ -24,6 +24,8 @@
      */
     String [][] artifactFactoryNamesAndDescriptions();
 
+    ArtifactFactory getInternalArtifactFactory(String factoryName);
+
     Document createArtifactWithFactory(String factory, CallMeta callMeta)
         throws ArtifactDatabaseException;
 
--- a/artifacts/src/main/java/de/intevation/artifacts/CallContext.java	Tue Jan 12 08:42:49 2010 +0000
+++ b/artifacts/src/main/java/de/intevation/artifacts/CallContext.java	Fri Jan 15 17:39:32 2010 +0000
@@ -15,6 +15,8 @@
 
     Object globalContext();
 
+    ArtifactDatabase getDatabase();
+
     CallMeta getMeta();
     
     Object getContextValue(Object key);

http://dive4elements.wald.intevation.org