Changes between Version 5 and Version 6 of Html5UI


Ignore:
Timestamp:
Apr 3, 2013, 11:48:22 PM (11 years ago)
Author:
delawen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Html5UI

    v5 v6  
    1111== Overview ==
    1212
    13 This is a UI (based on the one developed for http://nationaalgeoregister.nl) using widgets and HTML5. Also improves jeeves on redirections.
     13This is a UI (based on the one developed for http://nationaalgeoregister.nl) [https://github.com/Delawen/core-geonetwork/tree/html5ui/web-client/src/main/resources/apps/html5ui using widgets and HTML5].
     14
     15Also improves jeeves on redirections. Jeeves doesn't support right now handling of customized headers on responses (appart from 404 and other automatic headers). To allow the service to redirect urls (http://----?uuid=XXX to http://----#|XXX) this pull request adds the "[https://github.com/Delawen/core-geonetwork/commit/1b851c3699a2b68e682069f4b13e70be7bb1e50c hability to add custom response headers]. This is mandatory to allow stateful urls on the app.
    1416
    1517https://github.com/geonetwork/core-geonetwork/pull/81
     
    4446mvn jetty:run -Penv-dev,html5ui
    4547
     48This is an html5 based UI which uses the wigets from geonetwork and the library ExtJS.
     49
     50It contains two maps: preview map and big map. You can access the big map
     51clicking on the preview map. Both maps have synchronized layers, so if you add
     52or remove (or change style) on one map layer, you will see that the other map
     53also changes.
     54
     55Tested in Chrome, Firefox and IE>8 (also works but with some penalties on IE7).
     56
     57=== Changing Style
     58
     59Basic changing styling is pretty easy with this UI:
     60
     61==== Colors
     62 
     63There is a file on web-client/src/main/resources/apps/html5ui/css/colors.css
     64which contains all the colors of the app.
     65
     66==== Page design
     67
     68The html is loaded from web/src/main/webapp/xsl/search.xsl This xsl is
     69interpreted by jeeves and transformed to show the basic page. The page scheme is
     70basically the same on all links, so if you change the position of some html
     71elements, they will be changed on all views.
     72
     73Don't forget that some of the elements are also placed with css.
     74
     75Specific 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
     79They are on web/src/main/resources/apps/html5ui/js/Templates.js
     80
     81==== Add more tabs
     82
     83To 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
     92The value of the string will be taken from the strings.xml file that
     93corresponds to the language used.
     94
     95==== Add a footer link
     96
     97Look 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
     105Maps are always loaded even if they are not displayed. You can change this
     106behaviour and allow (for example) the big map to be shown at all times. This is
     107the same for all elements you see that disappear.
     108
     109To change this behaviour you should take a look at GlobalFunctions.js file. For
     110each "view" you have one function that shows it and hides it. You can change
     111them to allow, for example, that the big map is not hidden when results are
     112shown:
     113
     114 * showBrowse
     115 * hideBrowse
     116 * showAdvancedSearch
     117 * hideAdvancedSearch
     118 * showBigMap
     119 * ...
     120 
     121If 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
     128To debug javascript you only have to add a "debug" or "debug=true" parameter to
     129the url like this: http://....../srv/eng/search?debug
     130
     131==== Adding more widgets
     132
     133Widgets 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
     138App.js creates the *app* global variable wich has (or should have) all the
     139information needed for the app to run.
     140
     141It 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
     164Should contain everything related to the authentication of the user like
     165control buttons to log in and log out and handles the cookie.
     166
     167===== app.mapApp
     168
     169Should control everything related to maps. For example, if you want to add a new layer to
     170the maps you should look here.
     171
     172Also initializes the maps (preview and big).
     173
     174===== app.searchApp
     175
     176Closely related to Catalogue.js, it launches searches and initializes the
     177results view. To change the advanced search you have to look here too.
     178
     179
    46180=== Backwards Compatibility Issues ===
    47181