metafresh logo and link to homepage

How to setup the standalone printing client with webui?

1. Prerequisites:

2. Prepare the printing client config file

# 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 ESB is listening for requests
de.metas.printing.client.endpoint.RestHttpPrintConnectionEndpoint.ServerUrl=http://your-esb-server:8182/printing

# the adempiere AD_User and password name of which the client shall use for the login
de.metas.printing.client.login.username=metasfresh-printing-client-test
de.metas.printing.client.login.password=metasfresh-printing-client-test

#The hostKey which the client will register itself with on ADempiere
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

Notes

3. Set up a dedicated printing client user

4. Start the printing client

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

5. configure the printing client in metasfresh

6. associate the printing client’s config with “yourself”

The hostkey is stored in the user’s session, so if you just logged in as “it”, you can select

SELECT updated, LoginUserName, hostkey FROM AD_Session
WHERE LoginUserName='it'
ORDER BY AD_Session_ID DESC LIMIT 1

Notes:

Once you have the host key, create a new record in “Drucker-Zuordnung” (AD_Printer_Config)

Now you are done..e.g. go to Wareneingangsdispo and press invoke the “Drucken Produktanlieferung” action.


Zur Quelldatei auf github.com