Required changes in Host
Include the cwi-integration Javascript file:
<script src="https://[hostname]/CongreeWebInterface/cwi-integration.js"</script>
Create a Javascript function that initializes and shows the Congree Sidebar:
Example 1: Authentication with Username and Password
<script type="text/javascript"> var congree = window.Congree || {}; window.Congree = congree; congree.loadSidebar = function (username, password) { congree.sidebar = new Congree.Sidebar({ serverAddress: "[hostname]", authentication: { userName: "[username]", password: "[password]", accessTokenURL: "[Congree Identity Server URL]", loginType: "usernamePassword" }, initialRuleSetName: "[ruleset]”, editors: [ Congree.AdapterFor.TextInput('textarea:not(.cke_source)'), Congree.AdapterFor.TextInput('input[type="text"]'), Congree.AdapterFor.TinyMce4('.tinymce4', 'tinymce'), Congree.AdapterFor.CKEditor4('.ckeditor4') ] }); congree.sidebar.show("congreeSidebar"); }; </script>
Include the CWI loader javascript file:
<script src="https://[hostname]/CongreeWebInterface/cwi-integration.loader.sample-sidebar.js"</script>
Example 2: Authentication via Trust CMS
<script type="text/javascript"> var congree = window.Congree || {}; window.Congree = congree; congree.loadSidebar = function (username, password) { congree.sidebar = new Congree.Sidebar({ serverAddress: "[hostname]", authentication: { userName: "SamWon", password: "[REST API secret]", loginType: "cms", accessTokenURL: "[Congree Identity Server URL]", thirdPartySystemsIdentifier: "Confluence" }, initialRuleSetName: "[ruleset]”, editors: [ Congree.AdapterFor.TextInput('textarea:not(.cke_source)'), Congree.AdapterFor.TextInput('input[type="text"]'), Congree.AdapterFor.TinyMce4('.tinymce4', 'tinymce'), Congree.AdapterFor.CKEditor4('.ckeditor4') ] }); congree.sidebar.show("congreeSidebar"); }; </script>
Include the CWI loader javascript file.
<script src="https://[hostname]/CongreeWebInterface/cwi-integration.loader.cms.js"</script>
Call Congree.loadSidebar() at a time when the specified elements are created.
If the username and password for Congree depend on a login of the host application, they can be supplied as parameters to that function.
The
Info:
You can configure the REST API Secret in %\Program Files\Congree Language Technologies GmbH\Congree Identity Server\appsettings.json% under:
"TrustCMSSecret": ""
The REST API Secret must be encoded in Base64.
Only relevant for dynamic display mode:
Call Congree.SidebarOverlay.show(), when the Congree Overlay should be shown, e.g. in the focus event of your editor elements.
Call Congree.SidebarOverlay.hide(), when the Congree Overlay should be hidden, e.g. in the blur event of your editor elements.