Author: bibryam
Date: Thu Apr  1 12:44:37 2010
New Revision: 929946

URL: http://svn.apache.org/viewvc?rev=929946&view=rev
Log:
Added createUpdateFacilityGeoPoint service for creating or updating geo points 
assigned to a facility.
Added facility geo point screen for editing and visualizing facility geo point.

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    
ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
    ofbiz/trunk/applications/product/servicedef/services_facility.xml
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=929946&r1=929945&r2=929946&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Thu Apr  1 
12:44:37 2010
@@ -4923,7 +4923,7 @@
     </property>
     <property key="PageTitleEditFacilityContent">
         <value xml:lang="en">Edit Facility Content for 
${facility.facilityName} [${facility.facilityId}]</value>
-    </property>    
+    </property>
     <property key="PageTitleEditFacilityGroup">
         <value xml:lang="de">Einrichtungsgruppe bearbeiten</value>
         <value xml:lang="en">Edit Facility Group</value>
@@ -5848,6 +5848,9 @@
         <value xml:lang="it">Posizione Stabilimento GeoLocation</value>
         <value xml:lang="zh">场所的地理位置</value>
     </property>
+    <property key="PageTitleFacilityGeoLocation">
+        <value xml:lang="en">Facility Geo Location</value>
+    </property>
     <property key="PageTitleFindConfigItems">
         <value xml:lang="de">Konfigurationsposition suchen</value>
         <value xml:lang="en">Find Config Items</value>
@@ -6876,6 +6879,9 @@
     <property key="ProductAddFacilityContent">
         <value xml:lang="en">Add Facility Content</value>
     </property>
+    <property key="ProductEditFacilityGeoLocation">
+        <value xml:lang="en">Edit Facility Geo Location</value>
+    </property>
     <property key="ProductAddFeature">
         <value xml:lang="de">Merkmal hinzufügen</value>
         <value xml:lang="en">Add Feature</value>

Modified: 
ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?rev=929946&r1=929945&r2=929946&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
 (original)
+++ 
ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
 Thu Apr  1 12:44:37 2010
@@ -1326,4 +1326,19 @@ under the License.
             <clear-field field="productFacilityCtx"/>
         </iterate>
     </simple-method>
+    <simple-method method-name="createUpdateFacilityGeoPoint" 
short-description="Create or update GeoPoint assigned to facility">
+        <if-empty field="parameters.geoPointId">
+            <set-service-fields service-name="createGeoPoint" 
to-map="createGeoPointMap" map="parameters"/>
+            <call-service service-name="createGeoPoint" 
in-map-name="createGeoPointMap">
+                <result-to-field result-name="geoPointId" field="geoPointId"/>
+            </call-service>
+            <entity-one value-field="facility" entity-name="Facility"/>
+            <set field="facility.geoPointId" from-field="geoPointId"/>
+            <store-value value-field="facility"/>
+            <else>
+                <set-service-fields service-name="updateGeoPoint" 
to-map="updateGeoPointMap" map="parameters"/>
+                <call-service service-name="updateGeoPoint" 
in-map-name="updateGeoPointMap"/>
+            </else>
+        </if-empty>
+    </simple-method>
 </simple-methods>
\ No newline at end of file

Modified: ofbiz/trunk/applications/product/servicedef/services_facility.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_facility.xml?rev=929946&r1=929945&r2=929946&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_facility.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_facility.xml Thu Apr  
1 12:44:37 2010
@@ -930,4 +930,14 @@ under the License.
         <description>Schedule service that updates lastInventoryCount hourly 
for products available in facility</description>
         <attribute name="recurrenceInfoId" mode="IN" type="String" 
optional="false"/>
     </service>
+    <service name="createUpdateFacilityGeoPoint" engine="simple" 
default-entity-name="GeoPoint"
+                
location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml"
 invoke="createUpdateFacilityGeoPoint">
+        <description>Create or update GeoPoint assigned to 
facility</description>
+        <permission-service service-name="facilityGenericPermission" 
main-action="UPDATE"/>
+        <attribute name="facilityId" mode="IN" type="String"/>
+        <auto-attributes include="all" mode="IN" optional="true"/>
+        <override name="dataSourceId" optional="false"/>
+        <override name="latitude" optional="false"/>
+        <override name="longitude" optional="false"/>
+    </service>
 </services>

Modified: 
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?rev=929946&r1=929945&r2=929946&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml 
(original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Thu 
Apr  1 12:44:37 2010
@@ -860,7 +860,17 @@ under the License.
         </response>
         <response name="error" type="view" value="EditFacilityContent"/>
     </request-map>
-
+    
+    <request-map uri="EditFacilityGeoPoint">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditFacilityGeoPoint"/>
+    </request-map>
+    <request-map uri="createUpdateFacilityGeoPoint">
+        <security auth="true" https="true"/>
+        <event type="service" path="" invoke="createUpdateFacilityGeoPoint"/>
+        <response name="success" type="view" value="EditFacilityGeoPoint"/>
+        <response name="error" type="view" value="EditFacilityGeoPoint"/>
+    </request-map>
     <!-- ================ Shipment Scheduling Requests ================= -->
     <request-map uri="Scheduling">
         <security https="true" auth="true"/>
@@ -1421,6 +1431,7 @@ under the License.
     <view-map name="BatchPrintShippingLabels" type="screenfop" 
page="component://product/widget/facility/FacilityScreens.xml#BatchPrintShippingLabels"
 content-type="application/pdf" encoding="none"/>
 
     <view-map name="EditFacilityContent" type="screen" 
page="component://product/widget/facility/FacilityScreens.xml#EditFacilityContent"/>
+    <view-map name="EditFacilityGeoPoint" type="screen" 
page="component://product/widget/facility/FacilityScreens.xml#EditFacilityGeoPoint"/>
 
     <view-map name="FindShipment" type="screen" 
page="component://product/widget/facility/ShipmentScreens.xml#FindShipment"/>
     <view-map name="ViewShipment" type="screen" 
page="component://product/widget/facility/ShipmentScreens.xml#ViewShipment"/>

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml?rev=929946&r1=929945&r2=929946&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml 
(original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml Thu Apr  
1 12:44:37 2010
@@ -931,4 +931,31 @@ under the License.
            </hyperlink>
         </field>   
     </form>
+
+    <form name="EditFacilityGeoPoint" type="single" 
target="createUpdateFacilityGeoPoint" default-map-name="geoPoint"
+        odd-row-style="alternate-row" header-row-style="header-row-2" 
default-table-style="basic-table hover-bar">
+        <field name="facilityId"><hidden value="${facilityId}"/></field>
+        <field name="geoPointId"><hidden/></field>
+        <field name="dataSourceId">
+            <drop-down allow-empty="false">
+                <entity-options description="${description}" 
entity-name="DataSource">
+                    <entity-constraint name="dataSourceTypeId" 
value="GEOPOINT_SUPPLIER"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="latitude"><text/></field>
+        <field name="longitude"><text/></field>
+        <field name="elevation"><text/></field>
+        <field name="elevationUomId">
+            <drop-down allow-empty="false">
+                <entity-options description="${description}" entity-name="Uom" 
key-field-name="uomId">
+                    <entity-constraint name="uomTypeId" 
value="LENGTH_MEASURE"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="information"><text size="50" maxlength="60"/></field>
+        <field name="selectButton" title="${uiLabelMap.CommonSubmit}"><submit 
button-type="button"/></field>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml?rev=929946&r1=929945&r2=929946&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml 
(original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml Thu Apr  
1 12:44:37 2010
@@ -156,6 +156,11 @@ under the License.
                 <parameter param-name="facilityId"/>
             </link>
         </menu-item>
+        <menu-item name="EditFacilityGeoPoint" 
title="${uiLabelMap.CommonGeoLocation}">
+            <link target="EditFacilityGeoPoint">
+                <parameter param-name="facilityId"/>
+            </link>
+        </menu-item>
     </menu>
     <menu name="InventoryItemLabelsTabBar" extends="CommonTabBarMenu" 
extends-resource="component://common/widget/CommonMenus.xml"
           default-menu-item-name="FindInventoryItemLabels">

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=929946&r1=929945&r2=929946&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml 
(original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Thu 
Apr  1 12:44:37 2010
@@ -1509,4 +1509,33 @@ under the License.
             </widgets>
          </section>
     </screen>
+
+    <screen name="EditFacilityGeoPoint">
+        <section>
+            <actions>
+                <set field="tabButtonItem" value="EditFacilityGeoPoint"/>
+                <set field="titleProperty" 
value="PageTitleFacilityGeoLocation"/>
+                <set field="facilityId" from-field="parameters.facilityId"/>
+                <entity-one entity-name="Facility" value-field="facility"/>
+                <get-related-one relation-name="GeoPoint" 
to-value-field="geoPoint" value-field="facility"/>
+                <get-related-one relation-name="ElevationUom" 
to-value-field="uom" value-field="geoPoint"/>
+                <set field="geoPoints[+0].lat" from-field="geoPoint.latitude"/>
+                <set field="geoPoints[0].lon" from-field="geoPoint.longitude"/>
+                <set field="geoChart.dataSourceId" 
from-field="geoPoint.dataSourceId"/>
+                <set field="geoChart.width" value="600px"/>
+                <set field="geoChart.height" value="500px"/>
+                <set field="geoChart.points" from-field="geoPoints"/>          
 
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFacilityDecorator" 
location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet id="edit-facility-geopoint" 
title="${uiLabelMap.ProductEditFacilityGeoLocation}" collapsible="true" 
initially-collapsed="true">
+                            <include-form name="EditFacilityGeoPoint" 
location="component://product/widget/facility/FacilityForms.xml"/>
+                        </screenlet>
+                        <include-screen name="geoChart" 
location="component://common/widget/CommonScreens.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>    
 </screens>


Reply via email to