You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/08/28 09:21:52 UTC

svn commit: r808786 - in /ofbiz/trunk/framework/webtools: config/WebtoolsUiLabels.xml webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy webapp/webtools/service/availableservices.ftl

Author: jleroux
Date: Fri Aug 28 07:21:52 2009
New Revision: 808786

URL: http://svn.apache.org/viewvc?rev=808786&view=rev
Log:
Fix a bug reported by Ján Valkovic on user ML about about service CreateLead informations in Webtools (actions is not the same as actionsAndSet)
in Webtools, in the ECA section of services info, the I have added a column for fields set.

In availableservices.ftl, I have also replaced
<td><b>${uiLabelMap.WebtoolsIsService}</b> ${condition.isService?default(uiLabelMap.CommonNA)}</td>
by
<#if condition.isService?has_content>
  <td><b>${uiLabelMap.WebtoolsIsService}</b> ${condition.isService}</td>
  <td colspan="2">&nbsp;</td>
</#if>

I think we don't need to show informations (actually always NA) about attributes not used. But as I was not sure everybody would agree, I only did this one as an example. So What do you think, should we do it for all occurrences ?


Modified:
    ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy
    ofbiz/trunk/framework/webtools/webapp/webtools/service/availableservices.ftl

Modified: ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml?rev=808786&r1=808785&r2=808786&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml (original)
+++ ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml Fri Aug 28 07:21:52 2009
@@ -1082,6 +1082,10 @@
         <value xml:lang="th">เครื่องมือ Entity XML </value>
         <value xml:lang="zh">实体XML工具</value>
     </property>
+    <property key="WebtoolsEnvName">
+        <value xml:lang="en">Env Name</value>
+        <value xml:lang="fr">Nom de var. d'env.</value>
+    </property>
     <property key="WebtoolsErrorLogLevel">
         <value xml:lang="en">Error</value>
         <value xml:lang="fr">Erreur</value>
@@ -1386,7 +1390,7 @@
     </property>
     <property key="WebtoolsInParameters">
         <value xml:lang="en">In parameters</value>
-        <value xml:lang="fr">Dans les paramètres</value>
+        <value xml:lang="fr">Paramètres en entrée</value>
         <value xml:lang="it">Parametri in Ingresso</value>
         <value xml:lang="ro">Parametri de Intrare</value>
         <value xml:lang="th">ค่าตัวแปร</value>
@@ -2659,6 +2663,10 @@
         <value xml:lang="th">รายการ Services สำหรับ</value>
         <value xml:lang="zh">服务列表:</value>
     </property>
+    <property key="WebtoolsSet">
+        <value xml:lang="en">Set</value>
+        <value xml:lang="fr">Affectation</value>
+    </property>
     <property key="WebtoolsShowShowWSDL">
         <value xml:lang="en">Show wsdl</value>
         <value xml:lang="fr">Montrer WSDL</value>

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy?rev=808786&r1=808785&r2=808786&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy Fri Aug 28 07:21:52 2009
@@ -77,96 +77,141 @@
             actions.setAccessible(true);
             actionsVal = actions.get(curRule);
             if (actionsVal) {
-                actionsList = new ArrayList(actionsVal.size());
+                actionsList = new ArrayList();
+                setsList = new ArrayList();
                 actionsVal.each { curAction ->
-                    actionMap = [:];
                     actionClass = curAction.getClass();
+                    if (org.ofbiz.service.eca.ServiceEcaAction.equals(actionClass)) {
+                        actionMap = [:];
 
-                    //eventName
-                    eventName = actionClass.getDeclaredField("eventName");
-                    eventName.setAccessible(true);
-                    eventNameVal = eventName.get(curAction);
-                    if (eventNameVal) {
-                        actionMap.eventName = eventNameVal as String;
-                    }
-                    eventName.setAccessible(false);
-
-                    //ignoreError
-                    ignoreError = actionClass.getDeclaredField("ignoreError");
-                    ignoreError.setAccessible(true);
-                    ignoreErrorVal = ignoreError.get(curAction);
-                    if (ignoreErrorVal) {
-                        actionMap.ignoreError = ignoreErrorVal as String;
-                    }
-                    ignoreError.setAccessible(false);
-
-                    //ignoreFailure
-                    ignoreFailure = actionClass.getDeclaredField("ignoreFailure");
-                    ignoreFailure.setAccessible(true);
-                    ignoreFailureVal = ignoreFailure.get(curAction);
-                    if (ignoreFailureVal) {
-                        actionMap.ignoreFailure = ignoreFailureVal as String;
-                    }
-                    ignoreFailure.setAccessible(false);
-
-                    //persist
-                    persist = actionClass.getDeclaredField("persist");
-                    persist.setAccessible(true);
-                    persistVal = persist.get(curAction);
-                    if (persistVal) {
-                        actionMap.persist = persistVal as String;
-                    }
-                    persist.setAccessible(false);
-
-                    //resultMapName
-                    resultMapName = actionClass.getDeclaredField("resultMapName");
-                    resultMapName.setAccessible(true);
-                    resultMapNameVal = resultMapName.get(curAction);
-                    if (resultMapNameVal) {
-                        actionMap.resultMapName = resultMapNameVal as String;
-                    }
-                    resultMapName.setAccessible(false);
-
-                    //resultToContext
-                    resultToContext = actionClass.getDeclaredField("resultToContext");
-                    resultToContext.setAccessible(true);
-                    resultToContextVal = resultToContext.get(curAction);
-                    if (resultToContextVal) {
-                        actionMap.resultToContext = resultToContextVal as String;
-                    }
-                    resultToContext.setAccessible(false);
-
-                    //resultToResult
-                    resultToResult = actionClass.getDeclaredField("resultToResult");
-                    resultToResult.setAccessible(true);
-                    resultToResultVal = resultToResult.get(curAction);
-                    if (resultToResultVal) {
-                        actionMap.resultToResult = resultToResultVal as String;
-                    }
-                    resultToResult.setAccessible(false);
-
-                    //serviceMode
-                    serviceMode = actionClass.getDeclaredField("serviceMode");
-                    serviceMode.setAccessible(true);
-                    serviceModeVal = serviceMode.get(curAction);
-                    if (serviceModeVal) {
-                        actionMap.serviceMode = serviceModeVal as String;
-                    }
-                    serviceMode.setAccessible(false);
-
-                    //serviceName
-                    serviceName = actionClass.getDeclaredField("serviceName");
-                    serviceName.setAccessible(true);
-                    serviceNameVal = serviceName.get(curAction);
-                    if (serviceNameVal) {
-                        actionMap.serviceName = serviceNameVal as String;
-                    }
-                    serviceName.setAccessible(false);
+                        //eventName
+                        eventName = actionClass.getDeclaredField("eventName");
+                        eventName.setAccessible(true);
+                        eventNameVal = eventName.get(curAction);
+                        if (eventNameVal) {
+                            actionMap.eventName = eventNameVal as String;
+                        }
+                        eventName.setAccessible(false);
+
+                        //ignoreError
+                        ignoreError = actionClass.getDeclaredField("ignoreError");
+                        ignoreError.setAccessible(true);
+                        ignoreErrorVal = ignoreError.get(curAction);
+                        if (ignoreErrorVal) {
+                            actionMap.ignoreError = ignoreErrorVal as String;
+                        }
+                        ignoreError.setAccessible(false);
+
+                        //ignoreFailure
+                        ignoreFailure = actionClass.getDeclaredField("ignoreFailure");
+                        ignoreFailure.setAccessible(true);
+                        ignoreFailureVal = ignoreFailure.get(curAction);
+                        if (ignoreFailureVal) {
+                            actionMap.ignoreFailure = ignoreFailureVal as String;
+                        }
+                        ignoreFailure.setAccessible(false);
+
+                        //persist
+                        persist = actionClass.getDeclaredField("persist");
+                        persist.setAccessible(true);
+                        persistVal = persist.get(curAction);
+                        if (persistVal) {
+                            actionMap.persist = persistVal as String;
+                        }
+                        persist.setAccessible(false);
+
+                        //resultMapName
+                        resultMapName = actionClass.getDeclaredField("resultMapName");
+                        resultMapName.setAccessible(true);
+                        resultMapNameVal = resultMapName.get(curAction);
+                        if (resultMapNameVal) {
+                            actionMap.resultMapName = resultMapNameVal as String;
+                        }
+                        resultMapName.setAccessible(false);
+
+                        //resultToContext
+                        resultToContext = actionClass.getDeclaredField("resultToContext");
+                        resultToContext.setAccessible(true);
+                        resultToContextVal = resultToContext.get(curAction);
+                        if (resultToContextVal) {
+                            actionMap.resultToContext = resultToContextVal as String;
+                        }
+                        resultToContext.setAccessible(false);
+
+                        //resultToResult
+                        resultToResult = actionClass.getDeclaredField("resultToResult");
+                        resultToResult.setAccessible(true);
+                        resultToResultVal = resultToResult.get(curAction);
+                        if (resultToResultVal) {
+                            actionMap.resultToResult = resultToResultVal as String;
+                        }
+                        resultToResult.setAccessible(false);
+
+                        //serviceMode
+                        serviceMode = actionClass.getDeclaredField("serviceMode");
+                        serviceMode.setAccessible(true);
+                        serviceModeVal = serviceMode.get(curAction);
+                        if (serviceModeVal) {
+                            actionMap.serviceMode = serviceModeVal as String;
+                        }
+                        serviceMode.setAccessible(false);
+
+                        //serviceName
+                        serviceName = actionClass.getDeclaredField("serviceName");
+                        serviceName.setAccessible(true);
+                        serviceNameVal = serviceName.get(curAction);
+                        if (serviceNameVal) {
+                            actionMap.serviceName = serviceNameVal as String;
+                        }
+                        serviceName.setAccessible(false);
+
+                        actionsList.add(actionMap);
+
+                    } else {  // FIXME : we should also show field-names and values for set operation
+                        setMap = [:];
+
+                        // fieldName
+                        fieldName = actionClass.getDeclaredField("fieldName");
+                        fieldName.setAccessible(true);
+                        fieldNameVal = fieldName.get(curAction);
+                        if (fieldNameVal) {
+                            setMap.fieldName = fieldNameVal as String;
+                        }
+                        fieldName.setAccessible(false);
+
+                        // envName
+                        envName = actionClass.getDeclaredField("envName");
+                        envName.setAccessible(true);
+                        envNameVal = envName.get(curAction);
+                        if (envNameVal) {
+                            setMap.envName = envNameVal as String;
+                        }
+                        envName.setAccessible(false);
+
+                        // value
+                        value = actionClass.getDeclaredField("value");
+                        value.setAccessible(true);
+                        valueVal = value.get(curAction);
+                        if (valueVal) {
+                            setMap.value = valueVal as String;
+                        }
+                        value.setAccessible(false);
+
+                        // format
+                        format = actionClass.getDeclaredField("format");
+                        format.setAccessible(true);
+                        formatVal = format.get(curAction);
+                        if (formatVal) {
+                            setMap.format = formatVal as String;
+                        }
+                        format.setAccessible(false);
 
-                    actionsList.add(actionMap);
+                        setsList.add(setMap);
+                    }
                 }
 
                 curRuleMap.actions = actionsList;
+                curRuleMap.sets= setsList;
             }
             actions.setAccessible(true);
 

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/service/availableservices.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/service/availableservices.ftl?rev=808786&r1=808785&r2=808786&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/service/availableservices.ftl (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/service/availableservices.ftl Fri Aug 28 07:21:52 2009
@@ -151,18 +151,27 @@
         <table class="basic-table" cellspacing='0'>
           <tr class="header-row">
             <td>${uiLabelMap.WebtoolsEventName}</td>
-            <td>${uiLabelMap.WebtoolsRunOnError}</td>
-            <td>${uiLabelMap.WebtoolsRunOnFailure}</td>
+            <#if ecaMapList.runOnError?exists>
+              <td>${uiLabelMap.WebtoolsRunOnError}</td>
+            </#if>
+            <#if ecaMapList.runOnFailure?exists>
+              <td>${uiLabelMap.WebtoolsRunOnFailure}</td>
+            </#if>
             <td>${uiLabelMap.WebtoolsActions}</td>
             <td>${uiLabelMap.WebtoolsConditions}</td>
+            <td>${uiLabelMap.WebtoolsSet}</td>
           </tr>
           <#list ecaMapList as ecaMap>
             <tr>
               <td>${ecaMap.eventName?if_exists}</td>
-              <td>${ecaMap.runOnError?if_exists}</div></td>
-              <td>${ecaMap.runOnFailure?if_exists}</div></td>
-              <td>
-                <#if ecaMap.actions?exists && ecaMap.actions?has_content>
+              <#if ecaMap.runOnError?exists>
+                <td>${ecaMap.runOnError}</div></td>
+              </#if>
+              <#if ecaMap.runOnFailure?exists>
+                <td>${ecaMap.runOnFailure}</div></td>
+              </#if>
+              <#if ecaMap.actions?has_content>
+                <td>
                   <#list ecaMap.actions as action>
                     <table class="basic-table" cellspacing='0'>
                       <tr>
@@ -186,17 +195,17 @@
                       </tr>
                     </table>
                   </#list>
-                </#if>
-              </td>
-              <td>
-                <#if ecaMap.conditions?exists && ecaMap.conditions?has_content>
+                </td>
+              </#if>
+              <#if ecaMap.conditions?has_content>
+                <td>
                   <#list ecaMap.conditions as condition>
                     <table class='basic-table' cellspacing='0'>
                       <tr>
                         <td><b>${uiLabelMap.WebtoolsCompareType}</b> ${condition.compareType?default(uiLabelMap.CommonNA)}</td>
                         <td>
                           <b>${uiLabelMap.WebtoolsConditionService}</b>
-                          <#if condition.conditionService?exists && condition.conditionService?has_content>
+                          <#if condition.conditionService?has_content>
                             <a href='<@o...@ofbizUrl>'>${condition.conditionService?default(uiLabelMap.CommonNA)}</a>
                           <#else>
                             ${condition.conditionService?default(uiLabelMap.CommonNA)}
@@ -205,7 +214,10 @@
                         <td><b>${uiLabelMap.WebtoolsFormat}</b> ${condition.format?default(uiLabelMap.CommonNA)}</td>
                       </tr>
                       <tr>
-                        <td><b>${uiLabelMap.WebtoolsIsService}</b> ${condition.isService?default(uiLabelMap.CommonNA)}</td>
+                        <#if condition.isService?has_content>
+                          <td><b>${uiLabelMap.WebtoolsIsService}</b> ${condition.isService}</td>
+                          <td colspan="2">&nbsp;</td>
+                        </#if>
                         <td><b>${uiLabelMap.WebtoolsIsConstant}</b> ${condition.isConstant?default(uiLabelMap.CommonNA)}</td>
                         <td><b>${uiLabelMap.WebtoolsOperator}</b> ${condition.operator?default(uiLabelMap.CommonNA)}</td>
                       </tr>
@@ -221,8 +233,38 @@
                       </tr>
                     </table><br/>
                   </#list>
-                </#if>
-              </td>
+                </td>
+              </#if>
+              <#if ecaMap.sets?has_content>
+                <td>
+                  <#list ecaMap.sets as set>
+                    <table class='basic-table' cellspacing='0'>
+                      <tr>
+                        <td><b>${uiLabelMap.WebtoolsFieldName}</b> ${set.fieldName?default(uiLabelMap.CommonNA)}</td>
+                        <td colspan="2">&nbsp;</td>
+                      </tr>
+                      <tr>
+                        <#if set.envName?has_content>
+                          <td><b>${uiLabelMap.WebtoolsEnvName}</b> ${set.envName}</td>
+                          <td colspan="2">&nbsp;</td>
+                        </#if>
+                      </tr>
+                      <tr>
+                        <#if set.value?has_content>
+                          <td><b>${uiLabelMap.CommonValue}</b> ${set.value}</td>
+                          <td colspan="2">&nbsp;</td>
+                        </#if>
+                      </tr>
+                      <tr>
+                        <#if set.format?has_content>
+                          <td><b>${uiLabelMap.WebtoolsFormat}</b> ${set.format}</td>
+                          <td colspan="2">&nbsp;</td>
+                        </#if>
+                      </tr>
+                    </table><br/>
+                  </#list>
+                </td>
+              </#if>
             </tr>
             <tr><td colspan='5'><hr></td></tr>
           </#list>