Skip to content
This repository was archived by the owner on Jun 16, 2023. It is now read-only.

Commit

Permalink
set/get hostname from store setting
Browse files Browse the repository at this point in the history
hansbak committed Jun 28, 2022
1 parent 2581a13 commit 832186f
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 7 additions & 1 deletion service/growerp/100/PartyServices100.xml
Original file line number Diff line number Diff line change
@@ -1586,7 +1586,13 @@ along with this software (see the LICENSE.md file). If not, see

<!-- update website settings-->
<set field="hostName" from="ec.web.getHostName(false)"/>
<if condition="hostName == '10.0.2.2'"><set field="hostName" value="localhost"/></if>
<if condition="hostName == '10.0.2.2' || hostname == '127.0.0.1'">
<set field="hostName" value="localhost"/></if>
<if condition="hostName == 'localhost'">
<set field="hostName" value="localhost:8080"/></if>
<if condition="hostName.indexOf('.', hostName.indexOf('.') + 1) != -1"><!-- two dots? -->
<set field="hostName" from="hostName.substring(hostName.indexOf('.')+1)"/>
</if>
<set field="hostName" value="${productStoreId}.${hostName}"/>
<entity-find entity-name="mantle.product.store.ProductStoreSetting" list="stores">
<econdition field-name="productStoreId" value="POPC_DEFAULT"/>
15 changes: 12 additions & 3 deletions service/growerp/100/WebsiteServices100.xml
Original file line number Diff line number Diff line change
@@ -60,10 +60,19 @@ along with this software (see the LICENSE.md file). If not, see
<set field="website" from="[:]"/>
<return error="true" message="No product store found for company $companyPartyId appl: $classificationId"/>
</if>
<set field="hostName" from="ec.web.getHostName(false)"/>
<entity-find entity-name="mantle.product.store.ProductStoreSetting" list="hostNames">
<econdition field-name="productStoreId" from="pages[0].productStoreId"/>
<econdition field-name="settingTypeEnumId" value="PsstHostname"/>
</entity-find>
<if condition="hostNames">
<set field="hostName" from="hostNames[0].settingValue"/>
<else>
<set field="hostName" value="????"/>
</else>
</if>
<if condition="hostName == '10.0.2.2'">
<set field="hostName" value="localhost:8080"/></if>
<set field="hostName" value="${pages[0].productStoreId}.${hostName}/store"/>
<set field="hostName" value="${pages[0].productStoreId}.localhost:8080"/></if>
<set field="hostName" value="${hostName}/store"/>
<set field="website" from="[
id: pages[0].productStoreId,
hostName: hostName,

0 comments on commit 832186f

Please sign in to comment.