| 48 | This is an html5 based UI which uses the wigets from geonetwork and the library ExtJS. |
| 49 | |
| 50 | It contains two maps: preview map and big map. You can access the big map |
| 51 | clicking on the preview map. Both maps have synchronized layers, so if you add |
| 52 | or remove (or change style) on one map layer, you will see that the other map |
| 53 | also changes. |
| 54 | |
| 55 | Tested in Chrome, Firefox and IE>8 (also works but with some penalties on IE7). |
| 56 | |
| 57 | === Changing Style |
| 58 | |
| 59 | Basic changing styling is pretty easy with this UI: |
| 60 | |
| 61 | ==== Colors |
| 62 | |
| 63 | There is a file on web-client/src/main/resources/apps/html5ui/css/colors.css |
| 64 | which contains all the colors of the app. |
| 65 | |
| 66 | ==== Page design |
| 67 | |
| 68 | The html is loaded from web/src/main/webapp/xsl/search.xsl This xsl is |
| 69 | interpreted by jeeves and transformed to show the basic page. The page scheme is |
| 70 | basically the same on all links, so if you change the position of some html |
| 71 | elements, they will be changed on all views. |
| 72 | |
| 73 | Don't forget that some of the elements are also placed with css. |
| 74 | |
| 75 | Specific css for this UI (not shared with other UIs like search or tabsearch) is placed on web-client/src/main/resources/apps/html5ui/css/main.css |
| 76 | |
| 77 | ==== Results view templates |
| 78 | |
| 79 | They are on web/src/main/resources/apps/html5ui/js/Templates.js |
| 80 | |
| 81 | ==== Add more tabs |
| 82 | |
| 83 | To add more tabs just look on search.xsl around line 240 (id="main-navigation") and add a new element like this: |
| 84 | |
| 85 | |
| 86 | <li> |
| 87 | <a id="new-tab" href="//TODO"> |
| 88 | <xsl:value-of select="/root/gui/strings/new-tab" /> |
| 89 | </a> |
| 90 | </li> |
| 91 | |
| 92 | The value of the string will be taken from the strings.xml file that |
| 93 | corresponds to the language used. |
| 94 | |
| 95 | ==== Add a footer link |
| 96 | |
| 97 | Look for the div element with id = "footer" and just add it: |
| 98 | |
| 99 | <li> |
| 100 | <a href="http://geonetwork-opensource.org/">GeoNetwork OpenSource</a> |
| 101 | </li> |
| 102 | |
| 103 | ==== Maps and other elements: change display behaviour |
| 104 | |
| 105 | Maps are always loaded even if they are not displayed. You can change this |
| 106 | behaviour and allow (for example) the big map to be shown at all times. This is |
| 107 | the same for all elements you see that disappear. |
| 108 | |
| 109 | To change this behaviour you should take a look at GlobalFunctions.js file. For |
| 110 | each "view" you have one function that shows it and hides it. You can change |
| 111 | them to allow, for example, that the big map is not hidden when results are |
| 112 | shown: |
| 113 | |
| 114 | * showBrowse |
| 115 | * hideBrowse |
| 116 | * showAdvancedSearch |
| 117 | * hideAdvancedSearch |
| 118 | * showBigMap |
| 119 | * ... |
| 120 | |
| 121 | If you add a new "view", you should update all this functions so the view is |
| 122 | hidden or shown when you want. |
| 123 | |
| 124 | === Changing more complex features |
| 125 | |
| 126 | ==== Debugging |
| 127 | |
| 128 | To debug javascript you only have to add a "debug" or "debug=true" parameter to |
| 129 | the url like this: http://....../srv/eng/search?debug |
| 130 | |
| 131 | ==== Adding more widgets |
| 132 | |
| 133 | Widgets are usually added on the file |
| 134 | /web-client/src/main/resources/apps/html5ui/js/App.js or one of its children |
| 135 | (see next section). |
| 136 | |
| 137 | ==== Global variable app |
| 138 | App.js creates the *app* global variable wich has (or should have) all the |
| 139 | information needed for the app to run. |
| 140 | |
| 141 | It also initializes some secondary objects which contains information and loads more widgets: |
| 142 | |
| 143 | init : function() { |
| 144 | |
| 145 | this.initializeEnvironment(); |
| 146 | |
| 147 | // Initialize utils |
| 148 | this.loginApp = new GeoNetwork.loginApp(); |
| 149 | this.loginApp.init(); |
| 150 | this.mapApp = new GeoNetwork.mapApp(); |
| 151 | this.mapApp.init(); |
| 152 | this.searchApp = new GeoNetwork.searchApp(); |
| 153 | this.searchApp.init(); |
| 154 | |
| 155 | if (urlParameters.create !== undefined && catalogue.isIdentified()) { |
| 156 | var actionCtn = Ext.getCmp('resultsPanel').getTopToolbar(); |
| 157 | actionCtn.createMetadataAction.handler.apply(actionCtn); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | |
| 162 | ===== app.loginApp |
| 163 | |
| 164 | Should contain everything related to the authentication of the user like |
| 165 | control buttons to log in and log out and handles the cookie. |
| 166 | |
| 167 | ===== app.mapApp |
| 168 | |
| 169 | Should control everything related to maps. For example, if you want to add a new layer to |
| 170 | the maps you should look here. |
| 171 | |
| 172 | Also initializes the maps (preview and big). |
| 173 | |
| 174 | ===== app.searchApp |
| 175 | |
| 176 | Closely related to Catalogue.js, it launches searches and initializes the |
| 177 | results view. To change the advanced search you have to look here too. |
| 178 | |
| 179 | |