de.metas.printing.client-jar-with-dependencies.jar, located in your metasfresh server’s
# the enpoint component to use for the connection. Can be changed e.e for testing de.metas.printing.client.IPrintConnectionEndpoint=de.metas.printing.client.endpoint.RestHttpPrintConnectionEndpoint # the URL where the printing endpoint is listening for requests de.metas.printing.client.endpoint.RestHttpPrintConnectionEndpoint.ServerUrl=http://<your-metasfresh-server>:8282/printing # the adempiere AD_User and password name of which the client shall use for the login de.metas.printing.client.login.apiToken=<the token you generated further up> #The hostKey under which the client will register it's local printers etc on metasfresh de.metas.printing.client.login.hostkey=PrintingHostService-TU-metas-printing-client-test #the poll interval in milliseconds. Default: 1000ms de.metas.printing.client.PrintingClientDaemon.PollIntervalMs=10000
de.metas.printing.client.endpoint.RestHttpPrintConnectionEndpoint.ServerUrl contains the URL to which the printing client shall connect.
The two properties
de.metas.printing.client.login..apiToken is basically the credential of an actual metasfrersh user (i.e. the one we created in step 1).
It makes sense to have that user be a dedicated user
which has no other purpose than to log on, transmit the printers it has local access to (and their trays) and receive print packages.
de.metas.printing.client.login.hostkey sets the hostkey with which the printers are associated.
Also associated with the hostkey can be a mapping between logical printers (like “invoice-printer”)
and actual printers the information of which is transmitted by a printing client.
de.metas.printing.client.PrintingClientDaemon.PollIntervalMs sets at which intervals the printing client shall query metasfresh for new print jobs.
(yes, we know that polling sucks..)
Start the printing client using
java -Xmx200m -Dconfig="<printing-client-config-file>" -jar <printing-client.jar>
The console output should look like this:
Jun 18, 2017 7:03:14 AM de.metas.printing.client.PrintingClientStandaloneService logVersionInfo INFO: Resource jar:file:<printing-client.jar>!/META-INF/MANIFEST.MF has version <printing-client-build-version> Jun 18, 2017 7:03:15 AM de.metas.printing.client.engine.PrintingClientDaemon loginIfNeeded INFO: Successfully logged in as user metasfresh-printing-client-test-IT. Received sessionId=1097453
When the printing client starts up, it does the following
AD_Printer_Config) records can select the prining client’s configuration
AD_Printer_Matching) tab and select the printing client’s printers (and trays) to associate with the logical printer(s) of metasfresh
AD_Printer_Matching) tab already contains one record for each logical metasfresh printer, with the client’s local default printer being selected.
Here the important part is to find out that user’s hostkey.
The hostkey is stored in the user’s session, so if you just logged in as “myLoginName”, you can select
SELECT updated, LoginUserName, hostkey FROM AD_Session WHERE LoginUserName='myLoginName' ORDER BY AD_Session_ID DESC LIMIT 1
192.168.134.10as your hostkey
Once you have the host key, create a new record in “Drucker-Zuordnung” (
Now you are done..e.g. go to Wareneingangsdispo and press invoke the “Drucken Produktanlieferung” action.