svn commit: r639097 - in /ofbiz/trunk/framework: service/src/org/ofbiz/service/ service/src/org/ofbiz/service/eca/ webtools/src/org/ofbiz/webtools/artifactinfo/ webtools/webapp/webtools/artifactinfo/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r639097 - in /ofbiz/trunk/framework: service/src/org/ofbiz/service/ service/src/org/ofbiz/service/eca/ webtools/src/org/ofbiz/webtools/artifactinfo/ webtools/webapp/webtools/artifactinfo/

jonesde
Author: jonesde
Date: Wed Mar 19 17:12:44 2008
New Revision: 639097

URL: http://svn.apache.org/viewvc?rev=639097&view=rev
Log:
Added more info about entities and services in the artifact info page

Modified:
    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
    ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java
    ofbiz/trunk/framework/webtools/webapp/webtools/artifactinfo/ArtifactInfo.ftl

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java?rev=639097&r1=639096&r2=639097&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java Wed Mar 19 17:12:44 2008
@@ -119,6 +119,22 @@
         return this.name + "[" + this.type + "-" + this.mode + "]" + (optional ? "" : "*");
     }
     
+    public String getName() {
+        return this.name;
+    }
+    
+    public String getType() {
+        return this.type;
+    }
+    
+    public String getMode() {
+        return this.mode;
+    }
+    
+    public boolean isOptional() {
+        return this.optional;
+    }
+    
     public Object getDefaultValue() {
         Object defaultValueObj = null;
         if (this.type != null) {

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java?rev=639097&r1=639096&r2=639097&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java Wed Mar 19 17:12:44 2008
@@ -80,10 +80,18 @@
         return this.serviceName;
     }
     
+    public String getServiceMode() {
+        return this.serviceMode;
+    }
+    
+    public boolean isPersist() {
+        return this.persist;
+    }
+
     public String getShortDisplayDescription() {
         return this.serviceName + "[" + this.serviceMode + (this.persist ? "-persist" : "") + "]";
     }
-
+    
     public boolean runAction(String selfService, DispatchContext dctx, Map<String, Object> context, Map<String, Object> result) throws GenericServiceException {
         if (serviceName.equals(selfService)) {
             throw new GenericServiceException("Cannot invoke self on ECA.");

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java?rev=639097&r1=639096&r2=639097&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java Wed Mar 19 17:12:44 2008
@@ -111,6 +111,10 @@
         // for classProperties add attribute names AND relationship names to get a nice, complete chart
         List<String> classPropertiesList = FastList.newInstance();
         topLevelMap.put("classProperties", classPropertiesList);
+        // conditions
+        for (ServiceEcaCondition ecaCondition: this.serviceEcaRule.getEcaConditionList()) {
+            classPropertiesList.add(ecaCondition.getShortDisplayDescription(useMoreDetailedNames));
+        }
         // actions
         for (ServiceEcaAction ecaAction: this.serviceEcaRule.getEcaActionList()) {
             if (useMoreDetailedNames) {
@@ -118,10 +122,6 @@
             } else {
                 classPropertiesList.add(ecaAction.getServiceName());
             }
-        }
-        // conditions
-        for (ServiceEcaCondition ecaCondition: this.serviceEcaRule.getEcaConditionList()) {
-            classPropertiesList.add(ecaCondition.getShortDisplayDescription(useMoreDetailedNames));
         }
         
         /* going to try this without any attributes...

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/artifactinfo/ArtifactInfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/artifactinfo/ArtifactInfo.ftl?rev=639097&r1=639096&r2=639097&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/artifactinfo/ArtifactInfo.ftl (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/artifactinfo/ArtifactInfo.ftl Wed Mar 19 17:12:44 2008
@@ -22,6 +22,13 @@
     <h1>Artifact Info (${artifactInfo.getDisplayType()}): ${artifactInfo.getDisplayName()}</h1>
 
     <#if artifactInfo.getType() == "entity">
+        <h2>Entity Fields</h2>
+        <table>
+        <#list artifactInfo.modelEntity.getFieldsCopy() as modelField>
+            <tr><td>${modelField.getName()}<#if modelField.getIsPk()>*</#if></td><td>${modelField.getType()}</td><td>${modelField.getDescription()?if_exists}</td></tr>
+        </#list>
+        </table>
+        
         <h2>Entities Related (One)</h2>
         <#list artifactInfo.getEntitiesRelatedOne()?if_exists as entityArtifactInfo>
             <@displayEntityArtifactInfo entityArtifactInfo=entityArtifactInfo/>
@@ -45,7 +52,19 @@
         <#list artifactInfo.getScreensUsingEntity()?if_exists as screenWidgetArtifactInfo>
             <@displayScreenWidgetArtifactInfo screenWidgetArtifactInfo=screenWidgetArtifactInfo/>
         </#list>
+        
     <#elseif artifactInfo.getType() == "service"/>
+        <h2>Service Info</h2>
+        <div>&nbsp;Description: ${artifactInfo.modelService.description}</div>
+        <div>&nbsp;Run (${artifactInfo.modelService.engineName}): ${artifactInfo.modelService.location} :: ${artifactInfo.modelService.invoke}</div>
+        <h2>Service Parameters</h2>
+        <table>
+            <tr><td>Name</td><td>Type</td><td>Optional</td><td>Mode</td></tr>
+        <#list artifactInfo.modelService.getModelParamList() as modelParam>
+            <tr><td>${modelParam.getName()}</td><td>${modelParam.getType()}</td><td><#if modelParam.isOptional()>optional<#else/>required</#if></td><td>${modelParam.getMode()}</td></tr>
+        </#list>
+        </table>
+        
         <h2>Entities Used By This Service</h2>
         <#list artifactInfo.getEntitiesUsedByService()?if_exists as entityArtifactInfo>
             <@displayEntityArtifactInfo entityArtifactInfo=entityArtifactInfo/>
@@ -85,6 +104,7 @@
         <#list artifactInfo.getScreensCallingService()?if_exists as screenWidgetArtifactInfo>
             <@displayScreenWidgetArtifactInfo screenWidgetArtifactInfo=screenWidgetArtifactInfo/>
         </#list>
+        
     <#elseif artifactInfo.getType() == "form"/>
     
     <#elseif artifactInfo.getType() == "screen"/>
@@ -151,13 +171,33 @@
 </#macro>
 
 <#macro displayServiceEcaArtifactInfo serviceEcaArtifactInfo>
-    <h4>Service ECA Rule: ${serviceEcaArtifactInfo.getDisplayName()}</h4>
+    <h4>Service ECA Rule: ${serviceEcaArtifactInfo.getDisplayPrefixedName()}</h4>
+    <#if serviceEcaArtifactInfo.serviceEcaRule.getEcaConditionList()?has_content>
+        <h4>ECA Rule Conditions</h4>
+        <#list serviceEcaArtifactInfo.serviceEcaRule.getEcaConditionList() as ecaCondition>
+            <div>&nbsp;-&nbsp;${ecaCondition.getShortDisplayDescription(true)}</div>
+        </#list>
+    </#if>
+    <#if serviceEcaArtifactInfo.serviceEcaRule.getEcaActionList()?has_content>
+        <h4>ECA Rule Actions</h4>
+        <table>
+        <#list serviceEcaArtifactInfo.serviceEcaRule.getEcaActionList() as ecaAction>
+            <tr>
+                <td><a href="<@ofbizUrl>ArtifactInfo?type=${artifactInfo.getType()}&amp;uniqueId=${ecaAction.getServiceName()}</@ofbizUrl>">${ecaAction.getServiceName()}</a></td>
+                <td>${ecaAction.getServiceMode()}<#if ecaAction.isPersist()>-persisted</#if></td>
+            </tr>
+        </#list>
+        </table>
+    </#if>
+    
+    <#-- leaving this out, will show service links for actions
     <#if serviceEcaArtifactInfo.getServicesCalledByServiceEcaActions()?has_content>
         <h4>Services Called By Service ECA Actions</h4>
         <#list serviceEcaArtifactInfo.getServicesCalledByServiceEcaActions() as serviceArtifactInfo>
             <@displayServiceArtifactInfo serviceArtifactInfo=serviceArtifactInfo/>
         </#list>
     </#if>
+    -->
     <#if serviceEcaArtifactInfo.getServicesTriggeringServiceEca()?has_content>
         <h4>Services Triggering Service ECA</h4>
         <#list serviceEcaArtifactInfo.getServicesTriggeringServiceEca() as serviceArtifactInfo>