|
Author: mor
Date: Wed Dec 16 14:27:50 2009 New Revision: 891248 URL: http://svn.apache.org/viewvc?rev=891248&view=rev Log: Added CRUD services for GeoPoint and FixedAssetGeoPoint entity. Additional changes are done to avoid possible NPE. Modified: ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/fixedasset/FixedAssetGeoLocation.groovy ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetGeoLocation.ftl ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyGeoLocation.groovy ofbiz/trunk/applications/party/webapp/partymgr/party/partygeolocation.ftl ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FacilityLocationGeoLocation.groovy ofbiz/trunk/applications/product/webapp/facility/facility/FacilityLocationGeoLocation.ftl ofbiz/trunk/framework/common/servicedef/services.xml ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GeoLocation.groovy ofbiz/trunk/framework/common/webcommon/WEB-INF/geolocation.ftl Modified: ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml Wed Dec 16 14:27:50 2009 @@ -278,4 +278,24 @@ <attribute name="assetDepreciationTillDate" type="List" mode="OUT" optional="false"/> <attribute name="assetNBVAfterDepreciation" type="List" mode="OUT" optional="false"/> </service> -</services> + + <!-- FixedAssetGeoPoint services --> + <service name="createFixedAssetGeoPoint" default-entity-name="FixedAssetGeoPoint" engine="entity-auto" invoke="create" auth="true"> + <description>Create a FixedAssetGeoPoint</description> + <permission-service service-name="fixedAssetPermissionCheck" main-action="CREATE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + <override name="fromDate" optional="true"/> + </service> + <service name="updateFixedAssetGeoPoint" default-entity-name="FixedAssetGeoPoint" engine="entity-auto" invoke="update" auth="true"> + <description>Update a FixedAssetGeoPoint</description> + <permission-service service-name="fixedAssetPermissionCheck" main-action="UPDATE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + </service> + <service name="deleteFixedAssetGeoPoint" default-entity-name="FixedAssetGeoPoint" engine="entity-auto" invoke="delete" auth="true"> + <description>Delete a FixedAssetGeoPoint</description> + <permission-service service-name="fixedAssetPermissionCheck" main-action="DELETE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + </service> +</services> \ No newline at end of file Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/fixedasset/FixedAssetGeoLocation.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/fixedasset/FixedAssetGeoLocation.groovy?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/fixedasset/FixedAssetGeoLocation.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/fixedasset/FixedAssetGeoLocation.groovy Wed Dec 16 14:27:50 2009 @@ -26,8 +26,8 @@ context.latestGeoPoint = latestGeoPoint; context.fixedAssetId = fixedAssetId; - if (latestGeoPoint) { + if (latestGeoPoint && latestGeoPoint.elevationUomId) { elevationUom = delegator.findOne("Uom", [uomId : latestGeoPoint.elevationUomId], false); context.elevationUomAbbr = elevationUom.abbreviation; } -} +} \ No newline at end of file Modified: ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetGeoLocation.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetGeoLocation.ftl?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetGeoLocation.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetGeoLocation.ftl Wed Dec 16 14:27:50 2009 @@ -21,7 +21,7 @@ <br>${uiLabelMap.CommonLatitude}${latestGeoPoint.latitude} <br>${uiLabelMap.CommonLongitude}${latestGeoPoint.longitude} <#if latestGeoPoint.elevation?has_content> - <br>${uiLabelMap.CommonElevation}${latestGeoPoint.elevation} ${elevationUomAbbr} + <br>${uiLabelMap.CommonElevation}${latestGeoPoint.elevation} ${elevationUomAbbr?if_exists} </#if> <#if latestGeoPoint.dataSourceId?has_content> <#if latestGeoPoint.dataSourceId == "GEOPT_GOOGLE"> Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyGeoLocation.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyGeoLocation.groovy?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyGeoLocation.groovy (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyGeoLocation.groovy Wed Dec 16 14:27:50 2009 @@ -33,7 +33,7 @@ latestGeoPoint = GeoWorker.findLatestGeoPoint(delegator, "PartyAndGeoPoint", "partyId", partyId, null, null); context.latestGeoPoint = latestGeoPoint; -if (latestGeoPoint) { +if (latestGeoPoint && latestGeoPoint.elevationUomId) { elevationUom = delegator.findOne("Uom", [uomId : latestGeoPoint.elevationUomId], false); context.elevationUomAbbr = elevationUom.abbreviation; } Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/partygeolocation.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/partygeolocation.ftl?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/party/partygeolocation.ftl (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/party/partygeolocation.ftl Wed Dec 16 14:27:50 2009 @@ -21,7 +21,7 @@ ${uiLabelMap.CommonLatitude}${latestGeoPoint.latitude}<br> ${uiLabelMap.CommonLongitude}${latestGeoPoint.longitude} <#if latestGeoPoint.elevation?has_content> - <br>${uiLabelMap.CommonElevation}${latestGeoPoint.elevation} ${elevationUomAbbr} + <br>${uiLabelMap.CommonElevation}${latestGeoPoint.elevation} ${elevationUomAbbr?if_exists} </#if> <#if latestGeoPoint.dataSourceId?has_content> <#if latestGeoPoint.dataSourceId == "GEOPT_GOOGLE"> Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FacilityLocationGeoLocation.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FacilityLocationGeoLocation.groovy?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FacilityLocationGeoLocation.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FacilityLocationGeoLocation.groovy Wed Dec 16 14:27:50 2009 @@ -28,8 +28,8 @@ context.facilityId = facilityId context.locationSeqId = locationSeqId - if (latestGeoPoint) { + if (latestGeoPoint && latestGeoPoint.elevationUomId) { elevationUom = delegator.findOne("Uom", [uomId : latestGeoPoint.elevationUomId], false) context.elevationUomAbbr = elevationUom.abbreviation } -} +} \ No newline at end of file Modified: ofbiz/trunk/applications/product/webapp/facility/facility/FacilityLocationGeoLocation.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityLocationGeoLocation.ftl?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/facility/FacilityLocationGeoLocation.ftl (original) +++ ofbiz/trunk/applications/product/webapp/facility/facility/FacilityLocationGeoLocation.ftl Wed Dec 16 14:27:50 2009 @@ -21,7 +21,7 @@ ${uiLabelMap.CommonLatitude}${latestGeoPoint.latitude}<br> ${uiLabelMap.CommonLongitude}${latestGeoPoint.longitude} <#if latestGeoPoint.elevation?has_content> - <br>${uiLabelMap.CommonElevation}${latestGeoPoint.elevation} ${elevationUomAbbr} + <br>${uiLabelMap.CommonElevation}${latestGeoPoint.elevation} ${elevationUomAbbr?if_exists} </#if> <#if latestGeoPoint.dataSourceId?has_content> <#if latestGeoPoint.dataSourceId == "GEOPT_GOOGLE"> Modified: ofbiz/trunk/framework/common/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services.xml?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/framework/common/servicedef/services.xml (original) +++ ofbiz/trunk/framework/common/servicedef/services.xml Wed Dec 16 14:27:50 2009 @@ -665,4 +665,29 @@ <attribute name="portletSeqId" type="String" mode="IN" optional="true"/> <attribute name="attributeMap" type="Map" mode="OUT" optional="true"/> </service> -</services> + + <!-- GeoPoint services --> + <service name="createGeoPoint" default-entity-name="GeoPoint" engine="entity-auto" invoke="create" auth="true"> + <description>Create a GeoPoint</description> + <permission-service service-name="commonGenericPermission" main-action="CREATE"/> + <auto-attributes include="pk" mode="OUT" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + <override name="dataSourceId" optional="false"/> + <override name="latitude" optional="false"/> + <override name="longitude" optional="false"/> + </service> + <service name="updateGeoPoint" default-entity-name="GeoPoint" engine="entity-auto" invoke="update" auth="true"> + <description>Update a GeoPoint</description> + <permission-service service-name="commonGenericPermission" main-action="UPDATE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + <override name="dataSourceId" optional="false"/> + <override name="latitude" optional="false"/> + <override name="longitude" optional="false"/> + </service> + <service name="deleteGeoPoint" default-entity-name="GeoPoint" engine="entity-auto" invoke="delete" auth="true"> + <description>Delete a GeoPoint</description> + <permission-service service-name="commonGenericPermission" main-action="DELETE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + </service> +</services> \ No newline at end of file Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GeoLocation.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GeoLocation.groovy?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GeoLocation.groovy (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GeoLocation.groovy Wed Dec 16 14:27:50 2009 @@ -17,7 +17,7 @@ * under the License. */ -if (geoPoint) { +if (geoPoint && geoPoint.elevationUomId) { elevationUom = delegator.findOne("Uom", [uomId : geoPoint.elevationUomId], false); context.elevationUomAbbr = elevationUom.abbreviation; } Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/geolocation.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/geolocation.ftl?rev=891248&r1=891247&r2=891248&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/geolocation.ftl (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/geolocation.ftl Wed Dec 16 14:27:50 2009 @@ -21,7 +21,7 @@ ${uiLabelMap.CommonLatitude}${geoPoint.latitude}<br> ${uiLabelMap.CommonLongitude}${geoPoint.longitude} <#if geoPoint.elevation?has_content> - <br>${uiLabelMap.CommonElevation}${geoPoint.elevation} ${elevationUomAbbr} + <br>${uiLabelMap.CommonElevation}${geoPoint.elevation} ${elevationUomAbbr?if_exists} </#if> <#if geoPoint.dataSourceId?has_content> <#if geoPoint.dataSourceId == "GEOPT_GOOGLE"> |
| Free forum by Nabble | Edit this page |
