Objectif Lune PrintShop PrintShop Web 2.1 Integration Guide

  • Hello! I am an AI chatbot trained to assist you with the Objectif Lune PrintShop PrintShop Web 2.1 Integration Guide. I’ve already reviewed the document and can help you find the information you need or explain it in simple terms. Just ask your questions, and providing more details will help me assist you more effectively!
PrintShop Web
MIS Integration Guide
PrintShop Web MIS Integration Guide
Document version: PSW 2.1 R3250
Date: October, 2007
Objectif Lune - Contact Information
Objectif Lune Inc.
2030 Pie IX, Suite 500
Montréal, QC
Canada H1V 2C8
Tel.: 514-875-5863
Fax: 514-342-5294
www.objectiflune.com
To find an Objectif Lune office near you and for more information on our products and services, visit:
www.objectiflune.com
PrintShop Web MIS Integration Guide | 3
Table of Contents
Introduction.................................................................................................................................................4
XML to File connector.................................................................................................................................4
MIS Connectors.........................................................................................................................................5
Enabling a MIS connector...........................................................................................................................6
Installed modules.........................................................................................................................................6
Properties.....................................................................................................................................................7
XML to File connector............................................................................................................................8
XML (eXtensible Markup Language)...........................................................................................................9
General information.....................................................................................................................................9
Push method..............................................................................................................................................10
XML options...............................................................................................................................................11
Post options...............................................................................................................................................12
File options................................................................................................................................................ 12
Sample POST receive script............................................................................................................. 13
PrintShop Web MIS Integration Guide | 4
Introduction
PrintShop Web comes with a framework for managing and describing modules. Modules are used to
add or customize functionality in specific areas of the application. One of these areas is the integration
of Management Information Systems (MIS)
The MIS Connector Framework is build on top of this module framework and is called at order creation
and order status changes. MIS Connectors are used to automatically transfer order information from
PrintShop Web to external MIS systems.
This document describes the MIS Connector Framework and the options of the XML to File connector.
XML to File connector
The XML To File connector is a generic MIS connector that ships with PrintShop Web. It uses common
technologies and methods to communicate between applications. Order information is written to XML
files and in addition this data can be sent to an external applications/web servers capable of receiving
POST data. Optionally a XSLT style sheet can be applied to change the structure of the XML data.
The source files of the this connector are publicly available and not encrypted. This allows third parties,
such as system integrators, to modify its functions and/or add functionality. This connector is entirely
written in the PHP scripting language.
PrintShop Web MIS Integration Guide | 5
MIS Connectors
MIS connectors add functionality to the PSW order creation and order status change processes. The
following diagram outlines these processes.
Order process flow diagram
The system performs the following tasks:
1 Order information is stored in the PSW database.
2 The system defines if email notification messages should be send.
3 The system checks for the active MIS connector, if found the functions of this connector are called.
4 The user interface (UI) of the system is updated.
PrintShop Web MIS Integration Guide | 6
Enabling a MIS connector
In order to activate the XML to File connector, carry out the following steps:
1 Click on Settings in the PSW menu bar, the Settings sections appears.
2 Click MIS Integration in the Settings sub menu. The MIS Integration page appears and shows
information about the current MIS connector (if one is selected).
3 Click Edit.
4 Select a connector from the Active Module pull down menu. The list shows the available MIS
connectors.
5 Click Save to activate the module.
Select a module from the list and click Save to activate the connector
Note: Orders that reside in your PSW environment upon enabling a connector are not handled
by the connector and thus their information is not pushed to an external application.
Installed modules
The Modules option in sub menu of the Settings section shows an overview of the installed modules.
The modules are grouped by their module type. Click the plus-icon in front of a module type to view the
available modules for that type. To access the properties page of a module simply click its name.
The Modules overview page
PrintShop Web MIS Integration Guide | 7
Properties
The properties of a connector differ from connector to connector. They depend on the options and
functions of that specific module.
To view and modify the properties of a connector (module) do the following:
1 Click on Settings in the PSW menu bar, the Settings sections appears.
2 In the Settings sub menu click Modules. The Modules overview page is shown.
3 Open MIS Modules entry in the overview by clicking the plus-icon in front of its name. A list of the
available connectors for this type is shown.
4 Click the name of the connector to view its properties. To modify the properties click the Edit button.
The Edit Properties page appears.
The following figure shows the properties page of the XML to File connector.
The properties page of the XML to File connector
PrintShop Web MIS Integration Guide | 8
XML to File connector
Previous versions of PSW contained a hard coded connector that wrote order information to XML files
at order creation and status changes. This functionality has been migrated to the XML to File connector
that comes with PSW 2.1 or later. This connector can perform the following tasks:
Write order information to a XML file.
Use a HTTP POST call to submit XML data to a predefined URL.
A combination of the above (write and POST)
Apply a XSLT style sheet to the XML data before writing it to disk and/or submitting the data.
The following sections describe the properties of this connector.
The properties page of the XML to File connector
PrintShop Web MIS Integration Guide | 9
XML (eXtensible Markup Language)
XML stands for eXtensible Markup Language. Since XML data is stored in plain text format, XML
provides a software- and hardware-independent way of sharing data. This makes it much easier to
create data that different applications can work with. It also makes it easier to expand or upgrade a
system to new operating systems, servers, applications, and new browsers.
The XML to File connector collects the order information and writes this data to XML files. The sample
below shows a part of a XML file generated by the XML to File connector. The names of the elements
match the fields names in the PrintShop Web database tables.
<PrintShopCommunication>
<PSW_to_MIS>
<fnTemplateID>15</fnTemplateID>
<fcTemplateName>Business Card</fcTemplateName>
<fnPublicationTypeID>15</fnPublicationTypeID>
<fnQuantity>100</fnQuantity>
<fcProductCode>BC_1up_FC_OLBV</fcProductCode>
<fnOrderID>15</fnOrderID>
<fdModifiedDate>2007-10-08 14:08:21</fdModifiedDate>
<fnOrderStatusID>1</fnOrderStatusID>
<fcOrderStatus>cOrder</fcOrderStatus>
<fcComment></fcComment>
<fcContactName>Max Mustermann</fcContactName>
<fcContactEmail>[email protected]</fcContactEmail>
...
</PSW_to_MIS>
</PrintShopCommunication>
General information
The first section of the properties and edit properties page shows general information about the
connector. The information is static and cannot be changed through the PSW interface.
The General Information part of the XML to File properties
PrintShop Web MIS Integration Guide | 10
Push method
The Push method defines the method used for providing the order information to the outer world. You
can select one of the following options:
Write to folder
Post
Write to folder and Post
The Push method section of the XML to File properties
Write to folder
When the Write to folder option is selected an XML with the order information is created in a central
location. The element names in the XML data match the fields names in the PrintShop Web database
tables (tblorder). The files are stored in the Orders folder located in the Files folder of the PrintShop
Web web site folder. A file is created for each order using the orders internal database ID (primary
key). External systems could monitor this folder and act when files are added to this folder. For this you
could use applications like PlanetPress Watch.
The location of the XML files created by the XML to File connector
Post
The XML to File connector has the ability to POST the XML data to a HTTP server. This enables the
connector to be truly server/application independent. All the HTTP server needs to do is have the
capability to receive HTTP POST calls and be able to pass the call on to some form of program (ASP,
CGI, Java Servlets, etc).
The combination of XML via HTTP calls acts as a kind of middle ware or glue to tie systems together.
The connector lets you specify the URL of the HTTP server. A sample POST receive script (written in
PHP) is stored in the folder of the XML to File connector.
PrintShop Web MIS Integration Guide | 11
XML options
XSLT is a language for transforming XML documents into XML documents or even plain text. With
XSLT you can add/remove elements and attributes to or from the output file. You can also rearrange
and sort elements, perform tests and make decisions about which elements to remove and keep. More
information can be found at: http://www.w3schools.com/
By activating the Apply XSLT style sheet option the connector will apply the XSLT style sheet stated
in the Style sheet text area to the XML output. It is applied before writing the information to disk or
before sending it using a HTTP POST call. This way the XML structure can be modified to match the
requirements of the receiving application.
The XML options section
Sample XML files may be obtainded by setting up a demo version of PSW on your local machine
and using the Write to file option. The resulting file than can be used in a application like XML Spy or
Cooktop to develop the XSLT style sheet.
<!--This is an sample stylesheet-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<PrintShopCommunication>
<Order>
<xsl:attribute name="id"><xsl:value-of select="//fnOrderID"/></xsl:attribute>
<xsl:attribute name="statusid"><xsl:value-of
select="//fnOrderStatusID"/></xsl:attribute>
<xsl:attribute name="status"><xsl:value-of select="//fcOrderStatus"/></xsl:attribute>
<Information>
<Created><xsl:value-of select="//fdCreated"/></Created>
</Information>
</Order>
</PrintShopCommunication>
</xsl:template>
</xsl:stylesheet>
PrintShop Web MIS Integration Guide | 12
The sample XSLT code creates the following XML output:
<PrintShopCommunication>
<Order id="19" statusid="1" status="cOrder">
<Information>
<Created>2007-10-08 16:01:41</Created>
</Information>
</Order>
</PrintShopCommunication>
Post options
The URL field lets you state the HTTP server address that is used when the POST method is selected.
File options
The File extension field lets you specify the extension that is used for the data file. By default the file
extension wil be XML as the connector exports XML files. A XSLT style sheet could be created to
output text files (f.e. Comma separated or tab delimited), in this case you can change the file extension
to txt.
PrintShop Web MIS Integration Guide | 13
Sample POST receive script
The following script is a sample on how to receive POST data in PHP. The code receives the XML
data sent by the XML to File connector and writes this information to disk using the ID of the order. The
sample file is supplied with PSW 2.1 and can be found at the following location:
C:\Program Files\PrintShop Web\Website\modules\mis\1\sample\receive.php
<?
/**
* Sample POST receive page
*
* This demo script creates a xml file based on the JobID of the received XML.
* The file is saved directly under the "C" directory
*
* To use this script, the following must be applied
* The module "XML to File" must be activated on "Settings"
* Either "Post" or "Move to folder and Post" must be selected as "PushMethod"
* "http://localhost/modules/mis/1/sample/receive.php" must be entered in "URL"
* Finally, as you change the status of the order, then "JobID.xml" will be created in
"C" directory
*
*/
$aParams[cContent] = $_POST[PSW_XML];
$aJobXML = simplexml_load_string($aParams[cContent] );
$aOrderID = $aJobXML->xpath('//fnOrderID');
$cDirectory = "C:/".$aOrderID[0].".xml";
if (!$handle = @fopen($cDirectory, 'w')) {
echo "Cannot open Ticket file ($cDirectory)";
exit;
}
if (fwrite($handle, $aParams[cContent]) === FALSE) {
echo "Cannot write to file ($cDirectory)";
exit;
}
fclose($handle);
chmod ($cDirectory, 0777);
?>
The $_POST variable is an array of variable names and values sent by the HTTP POST method.
PrintShop Web sends the XML stream in the PSW_XML POST variable. The script reads the value of
this variable and stores the data in a local variable.
The simplexml_load_string function is used to read the XML data and tto define the ID of the order.
The SimpleXML extension of PHP provides a set of functions to convert XML to an object that can be
processed with normal property selectors and array iterators. More information can be found at the
following url: http://www.php.net/simplexml
A xpath expression is used to retrieve a specific node of the XML order data (the fnOrderID element).
You can use the same method to retrieve any of the elements from the XML data and use it values
according to your needs.
At the end the XML data is written to a XML file using the order id as the file name.
PrintShop Web MIS Integration Guide | 14
ELECTRONIC END USER LICENSE AGREEMENT
FOR PRINTSHOP WEB
NOTICE TO USER: THIS IS A CONTRACT. BY INSTALLING THIS SOFTWARE YOU ACCEPT ALL THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
This Objectif Lune End User License Agreement accompanies the PrintShop Web product and related
explanatory materials ("Software"). The term "Software" also shall include any upgrades, modified versions
or updates of the Software licensed to you by Objectif Lune. Please read this Agreement carefully. Upon your
acceptance of this Agreement, Objectif Lune grants to you a nonexclusive license to use the Software, provided
that you agree to the following:
1 Use of the Software.
a You may install the Software on a hard disk or other storage device; install and use the Software on a
file server for use on a network for the purposes of:
(i) permanent installation onto hard disks or other storage devices or
(ii) use of the Software over such network; and make backup copies of the Software.
b You may make and distribute unlimited copies of the Software, including copies for commercial
distribution, as long as each copy that you make and distribute contains this Agreement, the
PrintShop Web installer, and the same copyright and other proprietary notices pertaining to this
Software that appear in the Software. If you download the Software from the Internet or similar
on-line source, you must include the Objectif Lune copyright notice for the Software with any on-line
distribution and on any media you distribute that includes the Software.
c Once you have purchased a licensed dongle, you need to register that dongle to receive technical
support.
2 Copyright
The Software is owned by Objectif Lune and its suppliers, and its structure, organization and code are
the valuable trade secrets of Objectif Lune and its suppliers. The Software also is protected by Dutch
Copyright Law.
3 Restrictions.
You agree not to modify, adapt, translate, reverse engineer, decompile, disassemble or otherwise
attempt to discover the source code of the Software. You may not alter or modify in any way the installer
program or create a new installer for the Software. The Software is licensed and distributed by Atlas for
creating optimized print jobs.
4 No Warranty.
The Software is being delivered to you AS IS and Objectif Lune makes no warranty as to its use or
performance.
OBJECTIF LUNE AND ITS SUPPLIERS DO NOT AND CANNOT WARRANT THE PERFORMANCE
OR RESULTS YOU MAY OBTAIN BY USING THE SOFTWARE OR DOCUMENTATION.
OBJECTIF LUNE AND ITS SUPPLIERS MAKE NO WARRANTIES, EXPRESS OR IMPLIED, AS TO
NONINFRINGEMENT OF THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY
PARTICULAR PURPOSE. IN NO EVENT WILL OBJECTIF LUNE OR ITS SUPPLIERS BE LIABLE
TO YOU FOR ANY CONSEQUENTIAL, INCIDENTAL OR SPECIAL DAMAGES, INCLUDING ANY
LOST PROFITS OR LOST SAVINGS, EVEN IF AN OBJECTIF LUNE REPRESENTATIVE HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY THIRD PARTY.
Some states or jurisdictions do not allow the exclusion or limitation of incidental, consequential or special
damages, or the exclusion of implied warranties or limitations on how long an implied warranty may last,
so the above limitations may not apply to you.
5 Governing Law and General Provisions.
This Agreement will be governed by the laws of the Netherlands, excluding the application of its conflicts
of law rules. This Agreement will not be governed by the United Nations Convention on Contracts for the
International Sale of Goods, the application of which is expressly excluded. If any part of this Agreement
is found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall
remain valid and enforceable according to its terms. You agree that the Software will not be shipped,
transferred or exported into any country or used in any manner prohibited by any export laws, restrictions
or regulations. This Agreement shall automatically terminate upon failure by you to comply with its terms.
This Agreement may only be modified in writing signed by an authorized officer of Objectif Lune.
YOUR ACCEPTANCE OF THE FOREGOING AGREEMENT WAS INDICATED DURING INSTALLATION.
/