Revision: 4433
          http://sourceforge.net/p/jump-pilot/code/4433
Author:   michaudm
Date:     2015-05-11 06:39:01 +0000 (Mon, 11 May 2015)
Log Message:
-----------
Improve error messages

Modified Paths:
--------------
    
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesExtension.java
    
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesToolbox.java
    
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetOfAttributes.java

Added Paths:
-----------
    
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump.properties
    
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump_fr.properties

Added: 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump.properties
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump.properties
                                (rev 0)
+++ 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump.properties
        2015-05-11 06:39:01 UTC (rev 4433)
@@ -0,0 +1,3 @@
+SetAttributesPlugIn = SetAttributes
+SetAttributesPlugIn.no-feature-found = No selected feature found in a matching 
editable layers
+SetAttributesPlugIn.not-consistent-with-schema = Set Attributes : 
inconsistency between attribute ''{0}'' and feature ''{1}'' #{2}
\ No newline at end of file

Added: 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump_fr.properties
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump_fr.properties
                             (rev 0)
+++ 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump_fr.properties
     2015-05-11 06:39:01 UTC (rev 4433)
@@ -0,0 +1,3 @@
+SetAttributesPlugIn = Jeu d'attributs
+SetAttributesPlugIn.no-feature-found = Aucun objet s\xE9lectionn\xE9 dans une 
couche modifiable \xE9ligible
+SetAttributesPlugIn.not-consistent-with-schema = Jeu d''attributs : 
incoh\xE9rence entre l''attribut ''{0}'' et l''objet ''{1}'' #{2}
\ No newline at end of file

Modified: 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesExtension.java
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesExtension.java
   2015-05-10 11:31:55 UTC (rev 4432)
+++ 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesExtension.java
   2015-05-11 06:39:01 UTC (rev 4433)
@@ -15,7 +15,7 @@
     }
 
     public String getVersion() {
-        return "0.3 (2015-05-05)";
+        return "0.4 (2015-05-11)";
     }
 
     public void configure(PlugInContext context) throws Exception {

Modified: 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesToolbox.java
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesToolbox.java
     2015-05-10 11:31:55 UTC (rev 4432)
+++ 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesToolbox.java
     2015-05-11 06:39:01 UTC (rev 4433)
@@ -105,7 +105,7 @@
                             for (Feature feature : features) {
                                 srcLayerMap.put(feature, feature.clone(false));
                             }
-                            
tgtLayerMap.putAll(setOfAttributes.setAttributes(selectionManager.getFeaturesWithSelectedItems(lyr)));
+                            
tgtLayerMap.putAll(setOfAttributes.setAttributes(selectionManager.getFeaturesWithSelectedItems(lyr),
 lyr.getName()));
                             mapSource.put(lyr,srcLayerMap);
                             mapTarget.put(lyr,tgtLayerMap);
                         }

Modified: 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetOfAttributes.java
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetOfAttributes.java
  2015-05-10 11:31:55 UTC (rev 4432)
+++ 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetOfAttributes.java
  2015-05-11 06:39:01 UTC (rev 4433)
@@ -25,6 +25,8 @@
 
     final Logger LOG = Logger.getLogger(SetOfAttributes.class);
 
+    I18N I18N_ = I18N.getInstance("set_attributes");
+
     FlexibleDateParser dateParser = new FlexibleDateParser();
 
     @XmlAttribute
@@ -70,7 +72,7 @@
      * @param features to be modified
      * @throws Exception
      */
-    public Map<Feature,Feature> setAttributes(Collection<Feature> features) 
throws Exception {
+    public Map<Feature,Feature> setAttributes(Collection<Feature> features, 
String layerName) throws Exception {
         // map original feature to modified features
         Map<Feature,Feature> map = new HashMap();
 
@@ -84,7 +86,9 @@
 
                     if (!schema.hasAttribute(name)) {
                         if (isAtomic()) {
-                            throw new Exception("Set attribute " + name + " is 
not consistent with feature schema of feature " + feature.getID());
+                            throw new 
Exception(I18N.getMessage("set_attributes",
+                                    
"SetAttributesPlugIn.not-consistent-with-schema",
+                                    new Object[]{name, layerName, 
feature.getID()}));
                         } else {
                             continue;
                         }
@@ -120,6 +124,7 @@
                 map.put(feature,newFeature);
             } catch(Exception e) {
                 LOG.warn(e.getMessage());
+                throw e;
             }
 
         }


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to