Author: adrianc
Date: Sat Jul 31 15:16:46 2010
New Revision: 981067
URL: http://svn.apache.org/viewvc?rev=981067&view=rev
Log:
Built out the new service parameter description feature. Descriptions defined
in service interfaces are not being copied to the implementations - so that
needs to be fixed.
Modified:
ofbiz/trunk/framework/service/servicedef/services.xml
ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java
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/service/servicedef/services.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/servicedef/services.xml?rev=981067&r1=981066&r2=981067&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/servicedef/services.xml (original)
+++ ofbiz/trunk/framework/service/servicedef/services.xml Sat Jul 31 15:16:46
2010
@@ -65,12 +65,25 @@ under the License.
<!-- Service Engine Interfaces -->
<service name="permissionInterface" engine="interface">
<description>Interface to describe base parameters for Permission
Services</description>
- <attribute name="mainAction" type="String" mode="IN" optional="true"/>
+ <attribute name="mainAction" type="String" mode="IN" optional="true">
+ <description>The action requiring permission. Must be one of
ADMIN, CREATE, UPDATE, DELETE, VIEW.</description>
+ </attribute>
+ <attribute name="primaryPermission" type="String" mode="IN"
optional="true">
+ <description>The permission to check - typically the name of an
application or entity.</description>
+ </attribute>
+ <attribute name="altPermission" type="String" mode="IN"
optional="true">
+ <description>Optional alternate permission to check. If the
primary permission check fails,
+ the alternate permission will be checked.</description>
+ </attribute>
<attribute name="resourceDescription" type="String" mode="IN"
optional="true">
- <!-- Note that this will be filled in either with what the user
specifies in the service definition, or will default to the service name. -->
+ <description>The name of the resource being accessed - defaults to
service name.</description>
+ </attribute>
+ <attribute name="hasPermission" type="Boolean" mode="OUT"
optional="false">
+ <description>Contains true if the requested permission has been
granted.</description>
+ </attribute>
+ <attribute name="failMessage" type="String" mode="OUT" optional="true">
+ <description>Contains an explanation if the permission was
denied.</description>
</attribute>
- <attribute name="hasPermission" type="Boolean" mode="OUT"
optional="false"/>
- <attribute name="failMessage" type="String" mode="OUT"
optional="true"/>
</service>
<service name="authenticationInterface" engine="interface">
@@ -84,7 +97,7 @@ under the License.
</service>
<service name="serviceStreamInterface" engine="interface">
- <description>Inteface to describe services call with
streams</description>
+ <description>Interface to describe services call with
streams</description>
<attribute name="inputStream" type="java.io.InputStream" mode="IN"/>
<attribute name="outputStream" type="java.io.OutputStream" mode="IN"/>
<attribute name="contentType" type="String" mode="OUT"/>
Modified:
ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java?rev=981067&r1=981066&r2=981067&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java
(original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java
Sat Jul 31 15:16:46 2010
@@ -517,7 +517,7 @@ public class ModelServiceReader implemen
ModelParam param = new ModelParam();
param.name =
UtilXml.checkEmpty(attribute.getAttribute("name")).intern();
- param.description = getCDATADef(baseElement, "description");
+ param.description = getCDATADef(attribute, "description");
param.type =
UtilXml.checkEmpty(attribute.getAttribute("type")).intern();
param.mode =
UtilXml.checkEmpty(attribute.getAttribute("mode")).intern();
param.entityName =
UtilXml.checkEmpty(attribute.getAttribute("entity-name")).intern();
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=981067&r1=981066&r2=981067&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
Sat Jul 31 15:16:46 2010
@@ -421,6 +421,7 @@ if (selectedService) {
curInParam.internal = curParam.internal ? uiLabelMap.CommonTrue :
uiLabelMap.CommonFalse;
curInParam.mode = curParam.mode;
curInParam.name = curParam.name;
+ curInParam.description = curParam.description;
curInParam.optional = curParam.optional ? uiLabelMap.CommonTrue :
uiLabelMap.CommonFalse;
curInParam.type = curParam.type;
inParamsList.add(curInParam);
@@ -440,6 +441,7 @@ if (selectedService) {
curOutParam.internal = curParam.internal ? uiLabelMap.CommonTrue :
uiLabelMap.CommonFalse;
curOutParam.mode = curParam.mode;
curOutParam.name = curParam.name;
+ curOutParam.description = curParam.description;
curOutParam.optional = curParam.optional ? uiLabelMap.CommonTrue :
uiLabelMap.CommonFalse;
curOutParam.type = curParam.type;
outParamsList.add(curOutParam);
@@ -458,6 +460,7 @@ if (selectedService) {
curOvrPrm.internal = curParam.internal ? uiLabelMap.CommonTrue
: uiLabelMap.CommonFalse;
curOvrPrm.mode = curParam.mode;
curOvrPrm.name = curParam.name;
+ curOvrParam.description = curParam.description;
curOvrPrm.optional = curParam.optional ? uiLabelMap.CommonTrue
: uiLabelMap.CommonFalse;
curOvrPrm.type = curParam.type;
ovrPrmList.add(curOvrPrm);
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=981067&r1=981066&r2=981067&view=diff
==============================================================================
---
ofbiz/trunk/framework/webtools/webapp/webtools/service/availableservices.ftl
(original)
+++
ofbiz/trunk/framework/webtools/webapp/webtools/service/availableservices.ftl
Sat Jul 31 15:16:46 2010
@@ -271,14 +271,21 @@ under the License.
<#-- End if service has ECA's -->
<#list selectedServiceMap.allParamsList?if_exists as paramList>
+ <style type="text/css">
+ .param-table tr td {
+ width: 12.5%;
+ vertical-align: top;
+ }
+ </style>
<div class="screenlet">
<div class="screenlet-title-bar">
<h3>${paramList.title}</h3>
</div>
<#if paramList.paramList?exists && paramList.paramList?has_content>
- <table class="basic-table" cellspacing='0'>
+ <table class="basic-table param-table" cellspacing='0'>
<tr class="header-row">
<td>${uiLabelMap.WebtoolsParameterName}</td>
+ <td>${uiLabelMap.CommonDescription}</td>
<td>${uiLabelMap.WebtoolsOptional}</td>
<td>${uiLabelMap.CommonType}</td>
<#-- <td>Default Value</td> -->
@@ -290,6 +297,7 @@ under the License.
<#list paramList.paramList as modelParam>
<tr>
<td>${modelParam.name?if_exists}</td>
+ <td>${modelParam.description?if_exists}</td>
<td>${modelParam.optional?if_exists}</td>
<td>${modelParam.type?if_exists}</td>
<#-- <td>[${modelParam.defaultValue?if_exists}]</td> -->