Skip to content

Commit

Permalink
Add various tags for Header
Browse files Browse the repository at this point in the history
  • Loading branch information
Jwager-SBRx committed Sep 2, 2021
1 parent 1c52bbb commit cf2a0eb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 22 deletions.
22 changes: 16 additions & 6 deletions screen/store/content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with this software (see the LICENSE.md file). If not, see
<if condition="!extraPathNameList"><script>ec.web.sendError(404, "No attachment specified", null); return;</script></if>
<set field="filename" from="extraPathNameList.remove(extraPathNameList.size()-1)"/>
<service-call name="org.moqui.impl.WikiServices.get#WikiPageAttachment" out-map="context"
in-map="[wikiSpaceId:wikiSpaceId, pagePath:extraPathNameList?.join('/'), filename:filename]"/>
in-map="[wikiSpaceId:wikiSpaceId, pagePath:extraPathNameList?.join('/'), filename:filename]"/>
<script>ec.web.sendResourceResponse(attachmentReference?.location, true)</script>
</actions><default-response type="none"/></transition>

Expand Down Expand Up @@ -60,15 +60,15 @@ along with this software (see the LICENSE.md file). If not, see
<!-- get the wikiSpaceId for the store space type -->
<!-- FUTURE: pass locale here if pulled from path or somewhere -->
<service-call name="popstore.StoreServices.get#WikiSpaceByType" out-map="spaceOut" out-map-add-to-existing="false"
in-map="[productStoreId:productStoreId, spaceTypeEnumId:spaceTypeEnumId]"/>
in-map="[productStoreId:productStoreId, spaceTypeEnumId:spaceTypeEnumId]"/>
<if condition="!spaceOut.wikiSpaceId">
<log level="warn" message="In content/sst no wiki space found for store ${productStoreId} and space type ${spaceTypeEnumId}"/>
<script>ec.web.sendError(404, "No content space found for type ${spaceTypeEnumId}", null)</script>
<return/>
</if>
<!-- get the page content -->
<service-call name="org.moqui.impl.WikiServices.get#PublishedWikiPageText" out-map="pageTextOut" out-map-add-to-existing="false"
in-map="[wikiSpaceId:spaceOut.wikiSpaceId, pagePath:extraPathNameList?.join('/'), versionName:ver]"/>
in-map="[wikiSpaceId:spaceOut.wikiSpaceId, pagePath:extraPathNameList?.join('/'), versionName:ver]"/>
<!-- NOTE: could pass filename (pageTextOut.pageReference.getFileName()) but want inline Content-Disposition -->
<script>ec.web.sendTextResponse(pageTextOut.pageText, pageTextOut.pageReference.getContentType(), null)</script>
</actions>
Expand All @@ -79,23 +79,33 @@ along with this software (see the LICENSE.md file). If not, see
<transition name="createRequest">
<actions>
<service-call name="mantle.request.RequestServices.create#ContactRequest"
in-map="context + [moquiSessionToken:ec.web.sessionToken]" out-map="context"/>
in-map="context + [moquiSessionToken:ec.web.sessionToken]" out-map="context"/>
</actions>
<default-response url="."/>
</transition>

<pre-actions>
<set field="pageTitle" from="sri.screenUrlInfo.extraPathNameList[0]" />
<if condition="sri.screenUrlInfo.extraPathNameList[0] != null">
<then>
<set field="pageDesc" from="sri.screenUrlInfo.extraPathNameList[0]"/>
</then><else>
<set field="pageDesc" value=""/>
</else>
</if>
</pre-actions>
<actions>
<set field="extraPathNameList" from="sri.screenUrlInfo.extraPathNameList"/>
<service-call name="org.moqui.impl.WikiServices.get#PublishedWikiPageText" out-map="context"
in-map="[wikiSpaceId:wikiSpaceId, pagePath:extraPathNameList?.join('/'), versionName:ver]"/>
in-map="[wikiSpaceId:wikiSpaceId, pagePath:extraPathNameList?.join('/'), versionName:ver]"/>
<!-- TODO: consider removing versionName:ver above in production so only published versions can be seen -->
</actions>
<widgets>
<render-mode><text type="html" location="${template_server_header}"/></render-mode>
<section name="PageTextSection" condition="pageText">
<widgets>
<render-mode><text type="html" location="${template_server_content}"/></render-mode>
</widgets>
</widgets>
<fail-widgets>
<render-mode><text type="html" location="component://PopRestStore/template/store/error.html.ftl"/></render-mode>
</fail-widgets>
Expand Down
39 changes: 23 additions & 16 deletions screen/store/product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ along with this software (see the LICENSE.md file). If not, see
<transition name="addToCart">
<actions>
<service-call name="popstore.CartServices.add#Product" out-map="addOut"
in-map="[productId:productId, quantity:quantity, currencyUomId:currencyUomId, productStoreId: productStoreId]"/>
<set field="addedCorrect" from="false"/>
<if condition="addOut.orderHeader != null">
<set field="addedCorrect" from="true"/>
</if>
in-map="[productId:productId, quantity:quantity, currencyUomId:currencyUomId, productStoreId: productStoreId]"/>
<set field="addedCorrect" from="false"/>
<if condition="addOut.orderHeader != null">
<set field="addedCorrect" from="true"/>
</if>
</actions>
<conditional-response url="."><condition><expression>categoryId != null</expression></condition><parameter name="categoryId"/><parameter name="addedCorrect"/></conditional-response>
<conditional-response url="."><condition><expression>searchParameter != null</expression></condition><parameter name="searchParameter"/><parameter name="addedCorrect"/></conditional-response>
Expand All @@ -51,15 +51,15 @@ along with this software (see the LICENSE.md file). If not, see

<transition name="addReview">
<actions>
<service-call name="popstore.ProductServices.create#ProductReview"
in-map="[productId:productId, productRating:productRating, productReview:productReview]"/>
<service-call name="popstore.ProductServices.create#ProductReview"
in-map="[productId:productId, productRating:productRating, productReview:productReview]"/>
</actions>
<default-response url="."/>
<error-response url="."/>
</transition>

<pre-actions>
<set field="star" from="5"/>
<set field="star" from="5"/>
<set field="imgContent" from="[]"/>
<set field="extraPathNameList" from="sri.screenUrlInfo.extraPathNameList"/>
<if condition="searchParameter"><set field="searchParameter" from="URLEncoder.encode(searchParameter, 'UTF-8')"/></if>
Expand Down Expand Up @@ -98,9 +98,16 @@ along with this software (see the LICENSE.md file). If not, see
<if condition="product.productName != null">
<set field="pageTitle" from="product.productName"/>
</if>
<if condition="product.description != null">
<then>
<set field="pageDesc" from="product.description"/>
</then><else>
<set field="pageDesc" value=""/>
</else>
</if>
</pre-actions>
<actions>
<!-- <service-call name="popstore.ProductServices.get#ProductInfo" out-map="product" in-map="[productId:productId]"/> -->
<service-call name="popstore.ProductServices.get#ProductInfo" out-map="product" in-map="[productId:productId]"/>
<service-call name="popstore.ProductServices.get#ProductQuantity" out-map="productQuantity" in-map="[productId:productId]"/>
<service-call name="popstore.ProductServices.get#ProductReviews" out-map="reviewsList" in-map="[productId:productId]"/>
<service-call name="popstore.ProductServices.find#ProductAvailability" in-map="context" out-map="context" />
Expand All @@ -109,13 +116,13 @@ along with this software (see the LICENSE.md file). If not, see

<set field="inStock" from="false"/>
<if condition="product.productTypeEnumId == 'PtVirtual'">
<service-call name="popstore.ProductServices.get#ProductVariantsDisplayInfo"
in-map="context" out-map="variantsList" />
<else>
<if condition="productAvailability.get(productId)">
<set field="inStock" from="true"/>
</if>
</else>
<service-call name="popstore.ProductServices.get#ProductVariantsDisplayInfo"
in-map="context" out-map="variantsList" />
<else>
<if condition="productAvailability.get(productId)">
<set field="inStock" from="true"/>
</if>
</else>
</if>

<if condition="categoryId">
Expand Down

0 comments on commit cf2a0eb

Please sign in to comment.