HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 Date: 2015-05-01 HTML5 Viewer Make-a-Topographic-Map Template: Disclaimer Installation Guide v0.4 1 HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 Date: 2015-05-01 Revision History Date April 9, 2015 April 13, 2015 April 21, 2015 Version .1 .2 .3 May 1, 2015 .4 Description Initial documentation Update of Disclaimer component Includes Index.html requirement and further update to the Disclaimer JS code. Updates to code and disclaimer.html Author Ralph Baehre Ralph Baehre Ralph Baehre Ralph Baehre Table of Contents 1.1 2.1 3.1 4.1 4.2 Introduction .......................................................................................................................... 2 Prerequisites ......................................................................................................................... 2 Install Package ..................................................................................................................... 3 Site Changes: Add Workflow .xaml to Site. ....................................................................... 3 Site Changes: Add Workflows. ....................................................................................... 3 4.2.1 Method 1: Add Workflow Reference to Site.xml. ..................................................................................3 4.2.2 Method 2: Add Workflow Reference via Geocortex Manager. ..............................................................4 4.3 Verification of Site Changes. ........................................................................................... 6 4.4 Rollback of Site Changes. ................................................................................................ 7 5.1 Viewer Changes. .................................................................................................................. 7 5.1.1 Site Viewer Changes. ...............................................................................................................................7 5.1.2 Common Viewer Changes. ......................................................................................................................9 5.2 Verification of Viewer Changes. .................................................................................... 10 5.3 Rollback of Viewer Changes.......................................................................................... 10 1.1 Introduction This document provides instruction to install the “Disclaimer” component for the HTML5 Viewer Make-a-Topographic-Map application template. 2.1 Prerequisites Geocortex Essentials 4.2 exists for this installation. This application has an associated Geocortex “site” installed in Geocortex Essentials v4.2 2 HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 Date: 2015-05-01 3.1 Install Package The installation package is called: GHV_MaTM_Disclaimer_v.4.zip. It includes: A .zip file called: Viewer_Disclaimer.zip; A .zip file called: Site_Workflows.zip; A file called: Configuration.js. A file file called: Index_disclaimer.html 4.1 Site Changes: Add Workflow .xaml to Site. 1. If a “Workflows” directory does not exist inside the < MaTM Site Location > (see Table 1) then create one. Extract the contents of the Site_Workflows.zip into the “Workflows” directory of the site. Table 1: Geocortex Essentials Site Details DEV GCE 4.2 MaTM Site Location D:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\essentials42\REST Elements\Sites\ Make_A_Topographic_Map Site Changes: Add Workflows. 4.2.1 Method 1: Add Workflow Reference to Site.xml. 2. Locate the Site.xml file in the < MaTM Site Location > . 3. Archive the Site.xml file. 4. Open the Site.xml file and locate the <Worfklows> tag. Add two new workflow references below the <Worfklows> tag. The contents of the workflow reference should include this xml snippet: <Workflow DisplayName="activateDisclaimer" ID="activateDisclaimer" Uri="{SiteUri}/Workflows/activateDisclaimer.xaml"> </Workflow> <Workflow DisplayName="Disclaimer" ID="disclaimer" Uri="{SiteUri}/Workflows/startup-disclaimer.xaml"> 3 HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 Date: 2015-05-01 <Properties> <Property Name="parcelAccepted" Value="False" /> <Property Name="serviceId" Value="3" /> </Properties> </Workflow> 5. Save the Site.xml file but wait to close until Step 7 completed. 6. From the < Site REST URL> determine the “Service Id” that is to be bound to the Disclaimer. That is, the map service will not be made available if the user selects “I Decline” in the Disclaimer. 7. In the Site.xml file go the xml snippet that was added in Step 3. Modify the “serviceId” value if required: <Property Name="serviceId" Value="3" /> NOTE: The “serviceId” refers to the service ID of the map service that is bound to the disclaimer, e.g., Assessment Parcel. 8. Save and close the Site.xml file. 4.2.2 Method 2: Add Workflow Reference via Geocortex Manager. 4.2.2.1 Workflow 1: “activateDisclaimer”. 1. Open the “Make_A_Topographic_Map” site in Geocortex Manager. 2. Open the Workflows view. 3. Click “Add Workflow”. 4. In the dialogue box: enter Name = “activateDisclaimer; enter ID = “activateDisclaimer”; browse to the Workflows folder where the “activateDisclaimer.xaml” file exists. 5. Click “Finish”. 6. Click “Save Site”. 4 HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 Date: 2015-05-01 4.2.2.2 Workflow 2: “disclaimer”. 7. In Workflows view click “Add Workflow”. 8. In the dialogue box: enter Name = “disclaimer; enter ID = “disclaimer”; browse to the Workflows folder where the “startup-disclaimer.xaml” file exists. Figure 2a: Worfklow Configuration in GCE Manager. 9. Click “Next”. 10. Enter default values for the two properties: parcelAccepted = “False”; serviceID = “3” 5 HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 Date: 2015-05-01 Figure 2b: Worfklow Configuration in GCE Manager. NOTE: The “serviceId” refers to the service ID of the map service that is bound to the disclaimer, e.g., Assessment Parcel. 11. Click “Finish”. 12. Click “Save Site”. 13. Close GCE Manager. 4.3 Verification of Site Changes. 1. Open the Geocortex Essentials Manager. Reload the site in Manager. No error should occur. 2. In a browser load the site REST data using the < Site REST URL>. See Table 2. Look to see that the “Disclaimer” workflow has been added to the site. Table 3: Site REST URL. DEV Site REST URL http://intra.test.giscoeapp.lrc.gov.on.ca/Geocortex/Essentials/essentials42/REST/sites/ Make_A_Topographic_Map 6 HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 4.4 Date: 2015-05-01 Rollback of Site Changes. 1. Replace the newly updated Site.xml with the one that was archived. 5.1 Viewer Changes. 5.1.1 Site Viewer Changes. 1. Locate the < MaTM Viewer Custom Location>. See Table 4. Table 4: Geocortex Essentials Viewer Details. DEV GCE MaTM Viewer Custom Location <MaTM Site Location>\Viewers\ MATM__HTML5\VirtualDirectory\Resources\Custom 2. To add the “GHV_Disclaimer” component to the Viewer extract the contents of the Viewer_Disclaimer.zip into the < MaTM Viewer Custom Location>. A “GHV_Disclaimer” directory should appear that contains the files required by the component. 3. Locate the “Config/Default/Desktop.json.js” file that houses the main application viewer configurations. See Table 4. Table 4: Geocortex Essentials Viewer Details. DEV GCE MaTM Viewer Configuration Location <MaTM Site Location>\ Viewers\ MATM__HTML5\VirtualDirectory\Resources\Config\Default 4. In a text editor, open the < MaTM Viewer Configuration Location >\Desktop.json.js file and the Configuration.js file that is located in the install package GHV_MaTM_Disclaimer_v.4.zip. 5. Copy the “libraries” reference in the Configuration.js file to the Desktop.json.js file in the appropriate location, under the “libraries” category: { "id": "GHV_Disclaimer", "uri": "Resources/Custom/GHV_Disclaimer/GHV_Disclaimer.js", "locales": [ 7 HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 Date: 2015-05-01 { "locale": "en-US", "uri": "Resources/Custom/GHV_Disclaimer/GHV_Disclaimer.en-US.json.js" }, { "locale": "fr-CA", "uri": "Resources/Custom/GHV_Disclaimer/GHV_Disclaimer.fr-CA.json.js" }] } 6. Copy the “modules” reference in the Configuration.js file to the Desktop.json.js file in the appropriate location, under the “modules” category. { "moduleName": "GHV_DisclaimerModule", "moduleType": "GISCOE.GHV_DisclaimerModule", "libraryId": "GHV_Disclaimer", "configuration": {}, "views": [ { "id": "GHV_DisclaimerView", "viewModelId": "GHV_DisclaimerViewModel", "type": "GISCOE.GHV_DisclaimerView", "markup": "Components/GHV_Disclaimer.html", "iconUri": "Resources/Custom/GHV_Disclaimer/GHV_Disclaimer.png", "region": "ModalWindowRegion", "visible": false, "configuration": {} }], "viewModels": [ { "id": "GHV_DisclaimerViewModel", "type": "GISCOE.GHV_DisclaimerViewModel", "configuration": {} }] } 7. Locate the “Workflows” module. 8. In the “startup” parameter of the Workflows configuration enter as follows: "startupWorkflows": ["activateDisclaimer"], 9. Save the Desktop.json.js file and close the text editor. 8 HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 Date: 2015-05-01 5.1.2 Common Viewer Changes. 5.1.2.1 Modify “Index.html” File. 1. Locate the “Index.html” file of the Common Viewer. 2. Archive this file for rollback purposes. 3. Open “Index.html” file in a text editor. 4. Open the “Index_disclaimer.html” file located in the install package: GHV_MaTM_Disclaimer_v.4.zip in a text editor also. 5. Locate the following code between these comments “/*Start of Disclaimer code ... keydown event handling */” . . . /*End of Disclaimer code ... keydown event handling */ 6. Cut and paste the code snippet in the same location of the “Index.html” file. 7. Save and close the “Index.html” file. Close the “Index_disclaimer.html” file. 5.1.2.2 Add Disclaimer html Files to Custom Folder. 1. Create a “Disclaimer” folder in the “Resources/Custom” directory of the Common Viewer. 2. Copy the “disclaimer_en.html” and “disclaimer_fr.html” files located in the install package Viewer_Disclaimer.zip to the “Resources/Custom” directory of the Common Viewer. 9 HTML5 Viewer MaTM Template: Disclaimer Version: v.0.4 Installation Guide v0.4 5.2 Date: 2015-05-01 Verification of Viewer Changes. 1. Load the MaTM application into a browser using the <Application URL>. See Table 5. Table 5: Application URL D E V Example of Application URL http://intra.dev.giscoeapp.lrc.gov.on.ca/Html5Viewer23/Index_disclaimer.html?locale=enUS&configBase=http://intra.dev.giscoeapp.lrc.gov.on.ca/essentials42/REST/sites/RB_MAT M_v2/viewers/HTML5_Disclaimer/virtualdirectory/Resources/Config/Default 2. The Disclaimer should appear while the application is loading. 3. Test both “I Accept” and “I Decline” scenarios to determine whether the map service bound to the Disclaimer is made visible with the appropriate selection. 5.3 Rollback of Viewer Changes. 1. Remove the “GHV_Disclaimer component from the Viewer “Custom” folder. 2. Remove references to the “GHV_Disclaimer” from the Desktop.json.js file. 3. Restore the original copy of the “Index.html” file. 10