myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r740398 - in /myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator: crossval/strategy/ util/
Date Tue, 03 Feb 2009 19:54:38 GMT
Author: gpetracek
Date: Tue Feb  3 19:54:37 2009
New Revision: 740398

URL: http://svn.apache.org/viewvc?rev=740398&view=rev
Log:
EXTVAL-35 - intermediate result

Modified:
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/ELCompareStrategy.java
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/LocalCompareStrategy.java
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/util/CrossValidationUtils.java

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/ELCompareStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/ELCompareStrategy.java?rev=740398&r1=740397&r2=740398&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/ELCompareStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/ELCompareStrategy.java
Tue Feb  3 19:54:37 2009
@@ -28,8 +28,6 @@
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 import org.apache.myfaces.extensions.validator.core.el.ValueBindingExpression;
-import org.apache.myfaces.extensions.validator.core.property.PropertyDetails;
-import org.apache.myfaces.extensions.validator.core.property.PropertyInformationKeys;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -115,11 +113,15 @@
             CrossValidationStorageEntry crossValidationStorageEntry,
             ValueBindingExpression validationTarget)
     {
-        if(logger.isWarnEnabled())
-        {
-            PropertyDetails propertyDetails = crossValidationStorageEntry.getMetaDataEntry()
-                    .getProperty(PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class);
-            logger.warn("couldn't find converted object for " + propertyDetails.getKey());
-        }
+        FacesContext facesContext = FacesContext.getCurrentInstance();
+        Object targetValue = ExtValUtils.getELHelper().getValueOfExpression(facesContext,
validationTarget);
+
+        ProcessedInformationEntry targetEntry = new ProcessedInformationEntry();
+        targetEntry.setBean(
+                ExtValUtils.getELHelper().getValueOfExpression(facesContext, validationTarget.getBaseExpression()));
+        targetEntry.setConvertedValue(targetValue);
+
+        CrossValidationHelper
+                .crossValidateCompareStrategy(compareStrategy, crossValidationStorageEntry,
targetEntry, true);
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/LocalCompareStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/LocalCompareStrategy.java?rev=740398&r1=740397&r2=740398&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/LocalCompareStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/LocalCompareStrategy.java
Tue Feb  3 19:54:37 2009
@@ -88,10 +88,9 @@
             processCrossComponentValidation(compareStrategy, crossValidationStorageEntry,
validationTargetEntry);
         }
         //no target - because there is no target component - value was validated against
the model
-        else if(validationTargetEntry != null && isModelAwareValidation)
+        else if(isModelAwareValidation)
         {
-            processModelAwareCrossValidation(
-                    compareStrategy, crossValidationStorageEntry, validationTargetEntry,
targetProperty);
+            processModelAwareCrossValidation(compareStrategy, crossValidationStorageEntry,
targetProperty);
         }
         else
         {
@@ -182,14 +181,17 @@
     private void processModelAwareCrossValidation(
             AbstractCompareStrategy compareStrategy,
             CrossValidationStorageEntry crossValidationStorageEntry,
-            ProcessedInformationEntry validationTargetEntry,
             String targetProperty)
     {
-        validationTargetEntry
-                .setConvertedValue(getValueOfProperty(validationTargetEntry.getBean(), targetProperty));
+        ProcessedInformationEntry targetEntry = new ProcessedInformationEntry();
+
+        targetEntry.setBean(
+                crossValidationStorageEntry.getMetaDataEntry()
+                        .getProperty(PropertyInformationKeys.PROPERTY_DETAILS, PropertyDetails.class).getBaseObject());
+        targetEntry
+                .setConvertedValue(getValueOfProperty(targetEntry.getBean(), targetProperty));
 
         CrossValidationHelper
-                .crossValidateCompareStrategy(
-                        compareStrategy, crossValidationStorageEntry, validationTargetEntry,
true);
+                .crossValidateCompareStrategy(compareStrategy, crossValidationStorageEntry,
targetEntry, true);
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/util/CrossValidationUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/util/CrossValidationUtils.java?rev=740398&r1=740397&r2=740398&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/util/CrossValidationUtils.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/util/CrossValidationUtils.java
Tue Feb  3 19:54:37 2009
@@ -93,23 +93,6 @@
         //value not submitted at this request - use model value (validation against the model)
         if(processedInformationEntry == null)
         {
-            FacesContext facesContext = FacesContext.getCurrentInstance();
-            ProcessedInformationEntry newProcessedInformationEntry = new ProcessedInformationEntry();
-            ValueBindingExpression valueBindingExpression = new ValueBindingExpression("#{"
+ targetKey + "}");
-
-            Object baseObject = ExtValUtils.getELHelper()
-                    .getValueOfExpression(facesContext, valueBindingExpression.getBaseExpression());
-
-            if(baseObject != null)
-            {
-                newProcessedInformationEntry.setBean(baseObject);
-                newProcessedInformationEntry.setConvertedValue(
-                        ExtValUtils.getELHelper().getValueOfExpression(facesContext, valueBindingExpression));
-
-                return  newProcessedInformationEntry;
-            }
-
-            //TODO logging
             return null;
         }
 



Mime
View raw message