Server-side printing

You can implement server-side printing by following the instructions in this topic.

Procedure

  1. Create a new print service, say StoreOrderSummary_95. For more information about defining a service, refer Defining service definitions.
  2. Create a new Mashup to invoke the service as shown in the following code snippet and save it in the same folder as the screen files. For example, if you are creating a Mashup to print order summary, you can place it in <INSTALL_DIR>/repository/eardata/ngstore/store/views/order/order-summary.
    A sample mashup entry is as follows:
    <mashup description="Service for order summary prints" endpoint="EP_ORDER"
    		id="ordersummary_prints" mashuptype="XAPI" skipDataProvider="false"
    		transactional="true">
    		<classInformation name="com.ibm.wsc.common.mashups.WSCBaseMashup" />
    		<API FlowName="StoreOrderSummary_95">
    			<Input>
    				<Order OrderHeaderKey="" ShipNode="" Currency="" OrganizationCode="" DisplayLocalizedFieldInLocale="xml:CurrentUser:/User/@Localecode"/>
    			</Input>
    			<Template>
    				<Output out=""/>
    			</Template>
    		</API>
    		<APINamespace inputNS="prints_InputNS"
    			outputNS="prints_OutputNS" />
    		<AlternateResourceIds>
    			<AlternateResourceId altResourceId="WSCSYS00001" />
    		</AlternateResourceIds>
    	</mashup>
  3. Call the Mashup from the screen where you want to print a document. Ensure that you import all the necessary libraries before calling the mashup. Refer the following code snippet:
    uiPrintSummary : function(){
    			var inputObj = {};
    		             	inputObj.Order={};
    		             	var model= this.model.getCompleteOrderDetails.Order;
    		             	inputObj.Order.OrderHeaderKey = model.OrderHeaderKey;
    		             	inputObj.Order.ShipNode = model.SellerOrganizationCode;
    		            	inputObj.Order.Currency = model.PriceInfo.Currency;
    		            	inputObj.Order.OrganizationCode = model.EnterpriseCode;
    		             	iscMashup.callMashup(this,"ordersummary_prints",inputObj,{}).then(this.printCallBackHandler.bind(this));
    			},
    For more information about defining a mashup and calling the mashup from a screen, see Mashups.