cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r448035 [2/2] - in /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel: ./ library/ tree/builder/
Date Wed, 20 Sep 2006 02:48:03 GMT
Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/library/Library.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/library/Library.java?view=diff&rev=448035&r1=448034&r2=448035
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/library/Library.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/library/Library.java
Tue Sep 19 19:48:01 2006
@@ -19,18 +19,18 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.avalon.framework.CascadingException;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceSelector;
+
 import org.apache.cocoon.forms.FormsConstants;
 import org.apache.cocoon.forms.formmodel.WidgetDefinition;
 import org.apache.cocoon.forms.formmodel.WidgetDefinitionBuilder;
 import org.apache.cocoon.forms.formmodel.WidgetDefinitionBuilderContext;
 import org.apache.cocoon.forms.util.DomHelper;
 import org.apache.cocoon.util.location.LocationAttributes;
-import org.apache.commons.lang.StringUtils;
 
+import org.apache.commons.lang.StringUtils;
 import org.w3c.dom.Element;
 
 /**
@@ -174,15 +174,15 @@
         String widgetName = widgetDefinition.getLocalName();
         WidgetDefinitionBuilder builder;
         try {
-            builder = (WidgetDefinitionBuilder)widgetDefinitionBuilderSelector.select(widgetName);
+            builder = (WidgetDefinitionBuilder) widgetDefinitionBuilderSelector.select(widgetName);
         } catch (ServiceException e) {
-            throw new CascadingException("Unknown kind of widget '" + widgetName + "' at
" +
-                    DomHelper.getLocation(widgetDefinition), e);
+            throw new LibraryException("Unknown kind of widget '" + widgetName + "'.",
+                                       e, DomHelper.getLocationObject(widgetDefinition));
         }
 
         context.setSuperDefinition(null);
-        String extend = DomHelper.getAttribute(widgetDefinition, "extends", null);
 
+        String extend = DomHelper.getAttribute(widgetDefinition, "extends", null);
         if (extend != null) {
             context.setSuperDefinition(getDefinition(extend));
         }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/JavaTreeModelDefinitionBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/JavaTreeModelDefinitionBuilder.java?view=diff&rev=448035&r1=448034&r2=448035
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/JavaTreeModelDefinitionBuilder.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/JavaTreeModelDefinitionBuilder.java
Tue Sep 19 19:48:01 2006
@@ -15,7 +15,6 @@
  */
 package org.apache.cocoon.forms.formmodel.tree.builder;
 
-import org.apache.avalon.framework.CascadingException;
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.context.ContextException;
 import org.apache.avalon.framework.context.Contextualizable;
@@ -23,11 +22,14 @@
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
+
 import org.apache.cocoon.components.LifecycleHelper;
+import org.apache.cocoon.forms.FormsException;
 import org.apache.cocoon.forms.formmodel.tree.JavaTreeModelDefinition;
 import org.apache.cocoon.forms.formmodel.tree.TreeModel;
 import org.apache.cocoon.forms.formmodel.tree.TreeModelDefinition;
 import org.apache.cocoon.forms.util.DomHelper;
+
 import org.w3c.dom.Element;
 
 /**
@@ -37,11 +39,13 @@
  * @version $Id$
  */
 public class JavaTreeModelDefinitionBuilder extends AbstractLogEnabled
-    implements TreeModelDefinitionBuilder, Contextualizable, Serviceable {
+                                            implements TreeModelDefinitionBuilder, Contextualizable,
+                                                       Serviceable {
 
     Context ctx;
     ServiceManager manager;
 
+    
     public void contextualize(Context context) throws ContextException {
         this.ctx = context;
     }
@@ -57,13 +61,13 @@
         try {
             modelClass = Thread.currentThread().getContextClassLoader().loadClass(className);
         } catch(Exception e) {
-            throw new CascadingException("Cannot load class '" + className + "', at " +
-                                         DomHelper.getLocation(treeModelElement), e);
+            throw new FormsException("Cannot load class '" + className + "'.",
+                                     e, DomHelper.getLocationObject(treeModelElement));
         }
 
         if (!TreeModel.class.isAssignableFrom(modelClass)) {
-            throw new Exception("Class '" + className + "' doesn't implement TreeModel, at
" +
-                                DomHelper.getLocation(treeModelElement));
+            throw new FormsException("Class '" + className + "' doesn't implement TreeModel.",
+                                     DomHelper.getLocationObject(treeModelElement));
         }
 
         JavaTreeModelDefinition definition = new JavaTreeModelDefinition();

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/TreeDefinitionBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/TreeDefinitionBuilder.java?view=diff&rev=448035&r1=448034&r2=448035
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/TreeDefinitionBuilder.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/TreeDefinitionBuilder.java
Tue Sep 19 19:48:01 2006
@@ -18,13 +18,16 @@
 import java.util.Iterator;
 
 import org.apache.avalon.framework.service.ServiceSelector;
+
 import org.apache.cocoon.forms.FormsConstants;
+import org.apache.cocoon.forms.FormsException;
 import org.apache.cocoon.forms.formmodel.AbstractWidgetDefinitionBuilder;
 import org.apache.cocoon.forms.formmodel.WidgetDefinition;
 import org.apache.cocoon.forms.formmodel.tree.Tree;
 import org.apache.cocoon.forms.formmodel.tree.TreeDefinition;
 import org.apache.cocoon.forms.formmodel.tree.TreeSelectionListener;
 import org.apache.cocoon.forms.util.DomHelper;
+
 import org.w3c.dom.Element;
 
 /**
@@ -56,8 +59,8 @@
         } else if ("single".equals(selection)) {
             definition.setSelectionModel(Tree.SINGLE_SELECTION);
         } else {
-            throw new Exception("Invalid value selection value '" + selection + "' at " +
-                                DomHelper.getLocation(widgetElement));
+            throw new FormsException("Invalid value selection value '" + selection + "'.",
+                                     DomHelper.getLocationObject(widgetElement));
         }
 
         // Get the model optional element



Mime
View raw message