From Documentation

(Difference between revisions)
Jump to: navigation, search
(Default License Loading Path)
(Specify an Absolute Path with a Library Property)
Line 21: Line 21:
</source>
</source>
 +
It's also a way that multiple ZSS-bases applications can load the same license file.
<!--
<!--
http://tracker.zkoss.org/browse/ZSS-38
http://tracker.zkoss.org/browse/ZSS-38
-->
-->
-
 
= Specify the Path in a System Property =  
= Specify the Path in a System Property =  

Revision as of 02:11, 8 March 2019





You can choose one of the following ways to put a license file:

Contents

Default License Loading Path

ZSS loads a license file from the default path:

WEB-INF/classes/metainfo/zss/license/

This is the simplest way if you just have one zss-based web application.

Specify an Absolute Path with a Library Property

Some application servers like Weblogic could fail to locate the license file in the default path. You shall put the following library property in zk.xml to specify the license directory and copy your ZSS license file there.

<library-property>
    <name>org.zkoss.zssex.rt.Runtime.directory</name>
    <value>c:/my-directory/my-licenses/</value>
</library-property>

It's also a way that multiple ZSS-bases applications can load the same license file.

Specify the Path in a System Property

Because Library.getProperty() will look for a system property if no corresponding property defined in zk.xml, you can also pass the license file path to ZSS via a system property.

For example in a Tomcat, you can add a setenv.sh (or setenv.bat) that contains

export CATALINA_OPTS="$CATALINA_OPTS -Dorg.zkoss.zssex.rt.Runtime.directory=/absolutePathToYourLicenseFilePath/"

Tomcat catalina.sh will invoke this script if exists.

Refer to your application server's documentation to set a system property. In conclusion, you can pass the path in any way that can be retrieved by Java's System.getProperty(), e.g. a system variable in Windows.


License Information

If the license is loaded successfully, you should see some license information printed on your application console like:

*** Potix Corporation License Information ***

     Licensed Company: my company
     Certificate Number: 123456       
     Licensed Product: ZK Spreadsheet EE
     ...

     To renew, obtain more licenses, or if you require help, please contact info@zkoss.org.



All source code listed in this book is at Github.



Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.