1 Reply · Latest reply on Dec 28, 2017 1:42 AM by Sharath Lagisetty

    UI page - checkout view throwing error after jakarta upgrade

      Hi All,

      We are upgrading from Geneva to Jakart.

      UI page - com.glideapp.servicecatalog_checkout_view  is replaced with OOB version of Jakarta.

      Applied the below customization, but throwing an error. The element type "g2:evaluate" must be terminated by the matching end-tag "".

      Could you help here?

       

       

      Below is the customization

       

      <?xml version="1.0" encoding="utf-8" ?>

      <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

      <g:requires name="scripts/js_includes_catalog.js" includes="true" />

      <g:requires name="styles/js_includes_catalog.css" includes="true" />

      <g:requires name="styles/sc_cat_only.css" includes="false"/>

       

       

        <g2:inline template="output_messages.xml" />

        <j2:if test="$[sysparm_headless != 'true']">

        <table class="wide" cellspacing="0">

          <tr class="header" border="0" cellspacing="0">

            <td>

             

      <a onclick="history.go(-1);">

      <img height="16"

      width="16"

      src="images/green_back.gifx"

      title="${gs.getMessage('Back')}"

      alt="${gs.getMessage('Back')}"

      style="cursor:hand; margin: 0px; margin-left: 4px; margin-top: 3px; margin-bottom: 3px;"/>

      </a>

      </td>

      <td width="100%">

      <div class="caption">

      ${gs.getMessage('catalog_order_status')}

      </div>

            </td>

          </tr>

        </table>

        </j2:if>

        <j2:set var="jvar_never_show_price" value="$[gs.getProperty('glide.sc.price.display') == 'never']" />

        <g2:evaluate var="jvar_request" expression="

          sc_request = new GlideRecord('sc_request');

      var sys_id = '${sysparm_sys_id}';

       

       

      if (sys_id == null || sys_id == 'undefined' || sys_id == '')

        sys_id = '${sys_id}';

       

       

          sc_request.get(sys_id);

          " />

         <g2:evaluate var="jvar_request_item" expression="

          sc_req_item = new GlideRecord('sc_req_item');

          sc_req_item.addQuery('request', sys_id);

      sc_req_item.query();

          " />

          <g2:evaluate jelly="true">

             var permalink = 'com.glideapp.servicecatalog_checkout_view.do?sysparm_sys_id=' + sys_id;

          </g2:evaluate>

      <table class="wide">

      <tr>

      <td class="checkoutCenterWrapper" align="center">

      <table width="100%" cellspacing="0" class="checkoutBorder">

      <tr class="checkoutTitle">

      <td colspan="5" class="checkoutWhite"><strong>${gs.getMessage('Catalog Summary')}    </strong> </td>

      </tr>

      <tr>

      <td colspan="5" class="checkoutTitle tdwrap"> ${gs.getMessage('Your request number is')}$[SP]

      <strong>$[sc_request.number]</strong>, ${gs.getMessage('service_desk_request_reference_number')}

       

       

      <!--<br/><span class="catalog_summary_bookmark"> ${gs.getMessage('You may also bookmark the following link to get back to')}$[SP]

      <a class="linked" id="permalink" target="_top" href="nav_to.do?uri=$[permalink]">$[sc_request.number]</a>.

      <br/> ${gs.getMessage('bookmark_link_help_note')} </span>--></td>

      </tr>

      </table>

       

       

      <!-- Asterisk information -->

      <table class="wide" cellspacing="0">

         <br/>

      <tr border="0" cellspacing="0">

      <td colspan="5" rowspan="5">

      *The fulfillment of the Requested Item(s) will commence after the approval(s).

      </td>

      </tr>

      </table>

      <table width="100%" cellspacing="0">

      <tr>

      <td colspan="5">$[SP]</td>

      </tr>

      </table>

      <g:evaluate var="jvar_show_number" expression="gs.getProperty('glide.sc.checkout.request.number');"/>

      <g:evaluate var="jvar_descrption_column" expression="

      var prop = gs.getProperty('glide.sc.ess.description');

      if (prop == null || prop == '')

      prop = 'name';

      prop;

      "/>

      <table width="100%" cellpadding="0" cellspacing="0" class="checkoutBorder checkoutTDBORDER">

      <tr class="checkoutTitle">

      <j:if test="${jvar_show_number == 'true'}">

      <th class="checkoutCenter checkoutBorderRight">${gs.getMessage('Number')}</th>

      <th class="checkoutCenter checkoutBorderRight checkoutBorderLeft"> $[sc_request.description.sys_meta.label] </th>

      </j:if>

      <j:if test="${jvar_show_number != 'true'}">

      <th class="checkoutCenter checkoutBorderRight"> $[sc_request.description.sys_meta.label] </th>

      </j:if>

      <th class="checkoutCenter checkoutBorderRight checkoutBorderLeft"> Fulfillment Days*</th>

      <th class="checkoutCenter checkoutBorderRight checkoutBorderLeft"> ${gs.getMessage('catalog_stage')} </th>

                                                      <j2:if test="$[!jvar_never_show_price]">

              <th class="checkoutCenter checkoutBorderRight checkoutBorderLeft"> $[sc_request.price.sys_meta.label] (ea.) </th>

                                                      </j2:if>

      <th class="checkoutCenter checkoutBorderRight checkoutBorderLeft"> ${gs.getMessage('catalog_qty')} </th>

                                                      <j2:if test="$[!jvar_never_show_price]">

              <th class="checkoutCenter checkoutBorderLeft"> ${gs.getMessage('catalog_total')} </th>

      </j2:if>

      </tr>

      <g2:evaluate var="jvar_line_num" expression="0"/>

      <j2:set var="jvar_overall_total" value="0"/>

      <j2:set var="jvar_at_least_one" value="false"/>

      <g2:evaluate var="no_important" expression="var longestDueDate = 0"/>

      <j2:while test="$[sc_req_item.next()]">

                                                      <!-- set globals cart_item_price and sc_cat_item to be used in -->

                                                      <!-- com.glideapp.servicecatalog_show_price_function.xml -->

                                                      <g2:evaluate var="jvar_cat_item">

                                                              cart_item_price = sc_req_item.price;

                                                              sc_cat_item = new GlideRecord('sc_cat_item');

                                                              sc_cat_item.addQuery('sys_id', '$[sc_req_item.cat_item]');

                                                              sc_cat_item.query();

                                                              sc_cat_item.next(); 

                                                      </g2:evaluate>

                                                      <g2:inline template="com.glideapp.servicecatalog_show_price_function.xml" />

      <j2:set var="jvar_at_least_one" value="true"/>

       

       

       

       

       

       

       

       

       

       

       

      <!--For Delivery Days -->

      <g2:evaluate var="jvar_days">

      cart_item_price = sc_req_item.price;

      sc_cat_item = new GlideRecord('sc_cat_item');

      sc_cat_item.addQuery('sys_id', '$[sc_req_item.cat_item]');

      sc_cat_item.query();

       

       

      if(sc_cat_item.next())

      {

      a=sc_cat_item.delivery_time.getGlideObject().getNumericValue();

      days=parseInt(a/(1000*24*60*60));

      if(days==0)

      {

      days=0;

      }

      }

      </g2:evaluate>

       

       

       

       

       

       

       

       

       

       

                                                  <g2:evaluate var="smart_description">

      smart_description = sc_req_item.cat_item.${prop};

       

      if (smart_description == null || smart_description == '' || smart_description == 'undefined')

      smart_description = sc_req_item.cat_item.name;

      sc_req_item.putCurrent();

      var display_due_date = helper.longToDate(estimatedCompletion);

      estimatedCompletion;

      </g2:evaluate>

       

       

      <j2:set var="jvar_item_price" value="$[sc_req_item.price * sc_req_item.quantity]"/>

                                                      <!-- coerce to double to keep it working with currency_format tag -->

                                                      <j2:set var="jvar_item_price" value="$[jvar_item_price * 1]"/>

                                                      <g2:evaluate var="jvar_price">

                                                              var price = 0;

                                                              if($[show_price])

                                                                 price = $[jvar_item_price];

                                                              price;

                                                      </g2:evaluate>          

      <j2:set var="jvar_overall_total" value="$[jvar_overall_total + jvar_price]"/>

      <j2:set var="jvar_line_num" value="$[jvar_line_num + 1]"/>

      <j2:set var="jvar_line_color" value="checkoutOdd"/>

      <j2:if test="$[jvar_line_num % 2 == 0]">

      <j2:set var="jvar_line_color" value="checkoutEven"/>

      </j2:if>

      <g2:evaluate var="jvar_this_due" expression="display_due_date"/>

       

      <tr class="$[jvar_line_color]">

      <j:if test="${jvar_show_number == 'true'}">

      <td class="checkoutNumber">

      <a class="linked" href="sc_req_item.do?sys_id=$[sc_req_item.sys_id]$[AMP]sysparm_view=ess"> $[sc_req_item.number] </a>

      </td>

      <td class="checkoutDescription">

      $[smart_description]

      </td>

          </j:if>

      <j:if test="${jvar_show_number != 'true'}">

      <td class="checkoutDescription">

      <a class="linked" href="sc_req_item.do?sys_id=$[sc_req_item.sys_id]$[AMP]sysparm_view=ess"> $[smart_description] </a>

      </td>

      </j:if>

       

                                                             <j:if test="${jvar_days != 0}">

                                                             <td class="checkoutDueDate">$[jvar_days] Day(s)</td> </j:if>

       

       

                                                            

                                                             <td class="checkoutStage">

      <j:set var="ref" value="sc_req_item.stage"/>

      <g:inline template="item_workflow.xml"/>

      </td>

                                                              <j2:if test="$[!jvar_never_show_price]">

          <td class="checkoutPrice">

                                                                      <g2:evaluate>

                                                                          var item_price = '--';

                                                                          if($[show_price])

                                                                             item_price = sc_req_item.price;

                                                                          item_price;

                                                                      </g2:evaluate>

      <g2:currency_format double="$[item_price]"/>

          </td>

                                                              </j2:if>

      <td class="checkoutQuantity"> $[sc_req_item.quantity] </td>

                                                              <j2:if test="$[!jvar_never_show_price]">

          <td class="checkoutTotal">

                                                                      <g2:evaluate>

                                                                          var item_total = '--';

                                                                          if($[show_price])

                                                                             item_total = $[jvar_price];

                                                                          item_total;

                                                                      </g2:evaluate>

      <g2:currency_format double="$[item_total]"/>

          </td>

      </j2:if>

      </tr>

      </j2:while>

      <g2:evaluate var="not_important" expression="sc_req_item.popCurrent()"/>

      <!-- now add any template generated tasks -->

      <g2:evaluate var="jvar_task" expression="

      if (sys_id == '')

          sys_id = 'not_a_match';

      task = new GlideRecord('task');

                                                      task.addQuery('sys_class_name', '!=', 'sc_req_item');

                                                      task.addQuery('sys_class_name', '!=', 'sysapproval_group');

      task.addQuery('parent', sys_id);

      task.query();

      "/>

      <j2:while test="$[task.next()]">

      <tr>

      <j:if test="${jvar_show_number == 'true'}">

      <td class="checkoutNumber"> $[task.number] </td>

      </j:if>

      <td class="checkoutDescription"> $[task.short_description] </td>

      <td class="checkoutDueDate"> $[gs.getMessage('N/A')] </td>

      <td class="checkoutStage"> $[gs.getMessage('N/A')] </td>

      <td class="checkoutPrice"> -- </td>

      <td class="checkoutQuantity"> 1 </td>

      <td class="checkoutTotal"> -- </td>

      </tr>

      </j2:while>

       

      <j2:if test="$[jvar_at_least_one]">

      <tr>

      <td colspan="3"></td>

      <j:if test="${jvar_show_number == 'true'}">

      <td/>

      </j:if>

                                                              <j2:if test="$[!jvar_never_show_price]">

          <td colspan="2" class="checkoutTotalLabel">${gs.getMessage('Total')}:</td>

          <td class="checkoutTotalSum">

      <g2:currency_format variable="jvar_overall_total"/>

          </td>

                                                              </j2:if>

      </tr>

      </j2:if>

      </table>

       

      <!-- delivery information -->

      <table width="100%" cellspacing="0">

      <tr>

      <td colspan="5">$[SP]</td>

      </tr>

      </table>

      <table width="100%" cellpadding="0" cellspacing="0" class="checkoutBorder">

      <!--<tr class="checkoutTitle">

      <td class="checkoutWhite"> ${gs.getMessage('catalog_delivery_information')} </td>

      </tr>-->

      <!-- <tr>

      <g2:evaluate var="jvar_delivery_date" expression="

      var answer = 'Unknown';

      if (longestDueDate != 0) {

          var helper = new Packages.com.glideapp.servicecatalog.CalculationHelper();

      answer = helper.longToDate(longestDueDate);

      }

      answer;

      "/>

      <td colspan="5" class="catalogAlignCenter">${gs.getMessage('catalog_estimated_complete')}

      $[SP]<strong>$[jvar_delivery_date]</strong></td>

      </tr>-->

      </table>

       

       

       

       

       

       

      <!-- back buttons and whatnot -->

      <j2:if test="$[!Packages.com.glide.sys.Transaction.get().isVirtual()]">

      <table width="100%" cellspacing="0">

      <tr>

      <td colspan="3">$[SP]</td>

      </tr>

      <tr>

      <td>

      <div class="checkoutLeft">

      <a href="catalog_home.do?sysparm_view=catalog_default">

      <img src="images/back_to_catalog.pngx" alt="${gs.getMessage('Back to Catalog')}"></img>

      </a>

      </div>

      </td>

      <td align="center">

      <j2:set var="jvar_show_cancel" value="$[gs.getProperty('glide.sc.checkout.cancel')]"/>

      <j2:if test="$[jvar_show_cancel == 'true']">

      <g2:set_if var="jvar_condition" test="$[gs.getProperty('glide.sc.checkout.cancel.condition') == '']"

      true="true" false="$[gs.getProperty('glide.sc.checkout.cancel.condition')]" />

      <g2:evaluate>sc_request.putCurrent();</g2:evaluate>

      <g2:evaluate var="jvar_t" expression="$[jvar_condition]" />

      <g2:evaluate>sc_request.popCurrent();</g2:evaluate>

      <j2:if test="$[jvar_t]">

      <div>

      <a href="service_catalog.do?sysparm_action=request_cancel$[AMP]sysparm_id=$[sc_request.sys_id]$[AMP]sysparm_ck=$[gs.getSessionToken()]">

      <img src="images/cancel_request.pngx" alt="${gs.getMessage('Cancel')}"></img>

      </a>

      </div>

      </j2:if>

      </j2:if>

      </td>

      <td>

      <div class="checkoutRight">

      <a href="home.do">

      <img src="images/go_home.pngx" alt="${gs.getMessage('Home')}"></img>

      </a>

      </div>

      </td>

      </tr>

      </table>

      </j2:if>

      <j2:if test="$[Packages.com.glide.sys.Transaction.get().isVirtual()]">

        <script>

           fixPermaLink();

           function fixPermaLink() {

              var pl = '$[permalink]';

              var t = top.window.location+'';

              var ta = t.split('?');

              var root = ta[0];

              if (ta.length >1) {

                   root += '?';

                   ta = ta[1].split('$[AMP]');

                   for (var i=0; i != ta.length; i++) {

                      var s = ta[i];

                      var sa = s.split('=');

                      if (sa[0] != 'uri')

                       root += s;

                   }

                 }

              var url = root + '&amp;uri=' + pl;

              gel('permalink').href = url;

           }

        </script>

      </j2:if>

      </td>

      </tr>

      <g2:evaluate var="jvar_not_important" expression="

      var show_clone = gs.getProperty('glide.sc.allow.checkout.clone');

      var roles = gs.getProperty('glide.sc.allow.clone.roles');

      if (roles == null || roles == '')

      ;

      else {

          var hasRole = gs.hasRole(roles);

          if (hasRole == false)

              show_clone = false;

      }

      "/>

       

      <j2:if test="$[show_clone]">

      <tr>

      <td>

      <form name="clone_form" id="clone_form" action="service_catalog.do">

      <input name="sysparm_action" type="HIDDEN" value="request_clone"/>

      <input name="requestID" type="HIDDEN" value="$[sc_request.sys_id]"/>

      <input name="sysparm_referring_url" type="HIDDEN" value="${sysparm_referring_url}" />

      <table width="100%" cellspacing="0">

      <tr class="checkoutTitle">

      <td class="checkoutWhite">${gs.getMessage('catalog_clone')}</td>

      </tr>

      <j:set var="jvar_row" value="0"/>

      <j:set var="jvar_max_rows" value="10" />

      <j:set var="ref" value="sys_user" />

      <j:set var="jvar_question_reference" value="sys_user" />

      <g:evaluate var="not_important" expression="var jsrow=0;" />

      <j:while test="${jvar_row &lt; jvar_max_rows}">

      <j:set var="jvar_row" value="${jvar_row + 1}" />

      <g:evaluate var="jvar_question_name" expression="

      jsrow++;

      'sys_user:ZZYYXXclone_row'+jsrow;

      "/>

      <tr>

      <td >

      <g:inline template="lightweight_reference.xml"/>

      </td>

      </tr>

      </j:while>

      <tr>

      <td >

      <a onClick="document.getElementById('clone_form').submit();">

      <img src="images/order_now.pngx" alt="${gs.getMessage('Order Now')}"></img>

      </a>

      </td>

      </tr>

      </table>

      </form>

      </td>

      </tr>

      </j2:if>

      </table>

              <g:catalog_notify_cart_empty />  

      </j:jelly>