blob: 482929e4ab76fd5f5c45a42b5386c2deea0f3b25 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
<!-- Party events -->
<simple-method method-name="deleteParty" short-description="Delete Person">
<call-map-processor in-map-name="parameters" out-map-name="context">
<simple-map-processor name="deleteParty">
<process field="partyId"><copy/></process>
</simple-map-processor>
</call-map-processor>
<check-errors/>
<call-service service-name="deleteParty" in-map-name="context">
<default-message resource="PartyUiLabels" property="PartyPartySuccessfullyDeleted"/>
</call-service>
</simple-method>
<!-- Person events -->
<simple-method method-name="createPerson" short-description="Create Person">
<call-map-processor xml-resource="component://party/minilang/party/PartyMapProcs.xml"
processor-name="person" in-map-name="parameters" out-map-name="context"/>
<check-errors/>
<call-service service-name="createPerson" in-map-name="context">
<default-message resource="PartyUiLabels" property="PartyPersonSuccessfullyCreated"/>
<result-to-request result-name="partyId"/>
</call-service>
</simple-method>
<simple-method method-name="updatePerson" short-description="Update Person">
<set field="context.partyId" from-field="parameters.partyId"/>
<call-map-processor xml-resource="component://party/minilang/party/PartyMapProcs.xml"
processor-name="person" in-map-name="parameters" out-map-name="context"/>
<check-errors/>
<call-service service-name="updatePerson" in-map-name="context">
<default-message resource="PartyUiLabels" property="PartyPersonSuccessfullyUpdated"/>
</call-service>
</simple-method>
<!-- PartyGroup events -->
<simple-method method-name="createPartyGroup" short-description="Create Party Group">
<call-map-processor xml-resource="component://party/minilang/party/PartyMapProcs.xml"
processor-name="partyGroup" in-map-name="parameters" out-map-name="context"/>
<check-errors/>
<call-service service-name="createPartyGroup" in-map-name="context">
<default-message resource="PartyUiLabels" property="PartyPartyGroupSuccessfullyCreated"/>
<result-to-request result-name="partyId"/>
</call-service>
</simple-method>
<simple-method method-name="updatePartyGroup" short-description="Update Party Group">
<set field="context.partyId" from-field="parameters.partyId"/>
<call-map-processor xml-resource="component://party/minilang/party/PartyMapProcs.xml"
processor-name="partyGroup" in-map-name="parameters" out-map-name="context"/>
<check-errors/>
<call-service service-name="updatePartyGroup" in-map-name="context">
<default-message resource="PartyUiLabels" property="PartyPartyGroupSuccessfullyUpdated"/>
</call-service>
</simple-method>
<!--Party Content Events -->
<!-- create party content -->
<simple-method method-name="createPartyContent" short-description="Creates Party Associated Content" login-required="false">
<call-class-method class-name="org.apache.ofbiz.content.layout.LayoutWorker"
method-name="uploadImageAndParameters"
ret-field="formInput">
<field field="request" type="javax.servlet.http.HttpServletRequest"/>
<string value="dataResourceName"/>
</call-class-method>
<call-class-method class-name="org.apache.ofbiz.content.layout.LayoutWorker"
method-name="returnByteBuffer"
ret-field="byteWrap">
<field field="formInput" type="java.util.Map"/>
</call-class-method>
<set-service-fields service-name="uploadPartyContentFile" map="formInput.formInput" to-map="partyContentMap"/>
<set field="partyContentMap._uploadedFile_fileName" from-field="formInput.imageFileName"/>
<set field="partyContentMap.uploadedFile" from-field="byteWrap"/>
<set field="partyContentMap._uploadedFile_contentType" from-field="formInput.formInput.mimeTypeId"/>
<call-service service-name="uploadPartyContentFile" in-map-name="partyContentMap" break-on-error="false">
<result-to-field result-name="contentId" field="contentId"/>
</call-service>
<!-- set the partyId in the request -->
<field-to-request field="formInput.formInput.partyId" request-name="partyId"/>
<field-to-request field="contentId" request-name="contentId"/>
</simple-method>
<!-- Update party content -->
<simple-method method-name="updatePartyContent" short-description="Update Party Associated Content" login-required="false">
<call-class-method class-name="org.apache.ofbiz.content.layout.LayoutWorker"
method-name="uploadImageAndParameters"
ret-field="formInput">
<field field="request" type="javax.servlet.http.HttpServletRequest"/>
<string value="dataResourceName"/>
</call-class-method>
<call-class-method class-name="org.apache.ofbiz.content.layout.LayoutWorker"
method-name="returnByteBuffer"
ret-field="byteWrap"
>
<field field="formInput" type="java.util.Map"/>
</call-class-method >
<set-service-fields service-name="updateContentAndUploadedFile" map="formInput.formInput" to-map="partyContentMap"/>
<set field="partyContentMap.uploadedFile" from-field="formInput.imageData"/>
<set field="partyContentMap._uploadedFile_fileName" from-field="formInput.imageFileName"/>
<call-service service-name="updateContentAndUploadedFile" in-map-name="partyContentMap" break-on-error="false">
<result-to-field result-name="contentId" field="contentId"/>
</call-service>
<!-- set the partyId in the request -->
<field-to-request field="formInput.formInput.partyId" request-name="partyId"/>
<field-to-request field="contentId" request-name="contentId"/>
</simple-method>
<!-- GeoLocation services -->
<simple-method method-name="editGeoLocation" short-description="Edit GeoLocation">
<if-empty field="parameters.geoPointId">
<set field="createGeoPointMap.dataSourceId" value="GEOPT_GOOGLE"/>
<set field="createGeoPointMap.latitude" from-field="parameters.lat"/>
<set field="createGeoPointMap.longitude" from-field="parameters.lng"/>
<call-service service-name="createGeoPoint" in-map-name="createGeoPointMap">
<result-to-field result-name="geoPointId" field="geoPointId"/>
</call-service>
<now field="nowTimestamp"/>
<make-value value-field="partyGeoPoint" entity-name="PartyGeoPoint"/>
<set field="partyGeoPoint.partyId" from-field="parameters.partyId"/>
<set field="partyGeoPoint.geoPointId" from-field="geoPointId"/>
<set field="partyGeoPoint.fromDate" from-field="nowTimestamp"/>
<create-value value-field="partyGeoPoint"/>
<else>
<set field="updateGeoPointMap.geoPointId" from-field="parameters.geoPointId"/>
<set field="updateGeoPointMap.dataSourceId" value="GEOPT_GOOGLE"/>
<set field="updateGeoPointMap.latitude" from-field="parameters.lat"/>
<set field="updateGeoPointMap.longitude" from-field="parameters.lng"/>
<call-service service-name="updateGeoPoint" in-map-name="updateGeoPointMap"/>
</else>
</if-empty>
</simple-method>
</simple-methods>