Changes between Version 15 and Version 16 of WebInterface
- Timestamp:
- Apr 17, 2012, 9:13:25 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WebInterface
v15 v16 1 1 [[PageOutline]] 2 2 3 = Web interface = 4 The web based interface has many benefits and implements additional functionality. The main features of the web interface: 3 = Web interface 5 4 6 * The ability to run semantic queries - both global queries and queries starting with @ are supported 7 * The query construct assistant 8 * The query storage and the visualisation of the query result 9 * Possibility to see running queries and abort them if necessary 5 In addition to the console UIs, we also maintain a browser based (remote, via HTTP) interface to the tool, which provides an even more convenient way for code grokking. The main features of the web interface are: 6 7 * Running and exploring semantic queries (both normal and context-sensitive queries) 8 * Prev-next style browsing of query results 9 * Query construct assistant (auto-complete) 10 * Persistent queries 11 * Query schemes (skeletons) 12 * Management of (possibly multiple) running queries 10 13 * Database operations 11 14 * Ability to mark files with error forms 12 15 * Dependency examinations 13 16 17 ''Note that !JavaScript must be enabled in the browser to be able to use this interface.'' 14 18 15 !JavaScript must be enabled in the browser to be able to use the interface! 19 == Installation 16 20 17 = Installation = 18 To be able to use the web based interface we need to have an already working Yaws webserver. Help for the installation: http://yaws.hyber.org/yaws.pdf (Chapter 2). Recommended version is 1.92, but the minimum required version is 1.89 or higher. If you prefer using the 1.89 version of yaws, the -yaws_189 switch must be used during compilation: 21 The web based UI is built upon the [http://yaws.hyber.org/ Yaws] web server and the [http://nitrogenproject.com/ Nitrogen] framework. To be able to start this interface you need a Yaws web server installed. Installation help: http://yaws.hyber.org/yaws.pdf (see Chapter 2). 22 23 * Recommended version: 1.92 24 * Required version: 1.89 or higher. 25 26 If you prefer using the 1.89 version of yaws, please use the -yaws_189 option during compilation: 19 27 20 28 {{{ … … 22 30 }}} 23 31 32 == Starting up 24 33 25 = Start up = 26 We can start the interface either with {{{referl}}} script with {{{-nitrogen}}} switch, or from !RefactorErl shell. In both cases we get a default configuration with server name {{{localhost}}}, port {{{8001}}}, and IP {{{127.0.0.1.}}} 34 We can start the server either with the {{{referl}}} script using the {{{-nitrogen}}} option, or from a running !RefactorErl shell. Both cases provide a default configuration: server name {{{localhost}}}, port {{{8001}}}, and address {{{127.0.0.1.}}}, which can be overridden. 27 35 28 == Starting up with referl script == 29 Parameters to be configured: 36 Possible options: 30 37 31 * {{{-yaws path YPATH:}}} The absolute location of your Yaws ebin directory. 32 * {{{-yaws listen YLISTEN:}}} Valid IP address, which Yaws will listen to. 33 * {{{-yaws name YNAME:}}} Valid domain name, which Yaws will be bound to. 34 * {{{-yaws port YPORT:}}} Valid port number, which Yaws will be bound to. 35 * {{{-browser root BROOT:}}} The web interface allows database operations. The root directory for those operations can be set with this parameter. 36 * {{{-images dir IDIR:}}} Path of the directory where the generated images (visualisation of dependency examinations) will be written. 38 * {{{yaws_path YPATH}}} 39 40 The absolute location of your Yaws ebin directory. 37 41 38 Usage of switches is optional, except the {{{-nitrogen}}} switch. 42 * {{{yaws_listen YLISTEN}}} 39 43 44 Valid IP address, which Yaws will listen to. 40 45 46 * {{{yaws_name YNAME}}} 47 48 Valid domain name, which Yaws will be bound to. 49 50 * {{{yaws_port YPORT}}} 51 52 Valid port number, which Yaws will be bound to. 53 54 * {{{browser_root BROOT}}} 55 56 The web interface allows database operations. The root directory for those operations can be set with this parameter. 57 58 * {{{images dir IDIR}}} 59 60 Path of the directory where the generated images (visualisation of dependency examinations) will be placed. 61 62 === Startup: referl script 63 64 You can pass any of the above options via command-line arguments (note that {{{-nitrogen}}} is mandatory). 41 65 Example: 42 43 44 45 46 47 48 49 50 66 {{{ 67 bin/referl -nitrogen 68 -yaws_path /Users/V/yaws-1.89/ebin 69 -yaws_listen 127.0.0.1 70 -yaws_port 8000 71 -yaws_name localhost 72 -browser_root /Users/V/erlang 73 -images_dir /Users/V/graph_images 74 }}} 51 75 52 == Starting up from !RefactorErl shell == 53 We have 2 functions for starting the interface : {{{ri:start_nitrogen/0}}} and {{{ri:start_nitrogen/1}}}. The 0 arity function starts up the interface with default configuration. The 1 arity function allows the interface to be configured using a prop-list. Available properties are the same as described in the previous section. Usage of switches is optional. 54 Example: 55 {{{#!erlang 76 === Startup: !RefactorErl shell 77 78 We have two functions for starting the interface : {{{ri:start_nitrogen/0}}} and {{{ri:start_nitrogen/1}}}. Without passing any parameters the web server starts up with the default configuration. The 1-arity function allows the interface to be configured using an [http://www.erlang.org/doc/man/proplists.html Erlang proplist]. Example: 79 {{{ 80 #!erlang 81 56 82 ri:start_nitrogen([ 57 83 {yaws_path,"/Users/V/yaws-1.89/ebin"}, … … 64 90 65 91 66 = Shutting down = 67 It is important to log out before shutting down the interface, because the log out process will delete the dynamicly generated images, which belong to the user. If the interface was started from !RefactorErl shell, then {{{ri:stop_nitrogen().}}} can be called to shut down the interface. 92 == Shutting down 93 94 You are advised to always log out before shutting down the web server, because the log-out process deletes temporary, dynamically generated components of web pages. If the server has been started from the !RefactorErl shell, then {{{ri:stop_nitrogen()}}} should be called in order to shut down the service. 68 95 69 96 70 = Logging in = 71 To log in one must open a browser (recommended: Mozilla Firefox, Google Chrome) and enter the URL defined by the configuration (the default is {{{http://localhost:8001/}}}) after the web server had been started. Usage of services are allowed only to authorized people. First, you have to log in with a username (passwords are not supported yet). The browser will be redirected to the {{{queries}}} page. 97 == Logging in 72 98 99 In your favourite browser, navigate to the server address defined by the configuration (the default is {{{http://localhost:8001}}}) after the web server has been successfully started. Services are allowed only to authorized people, so first you have to log in with a username (passwords are not supported yet). The browser will be redirected to the ''queries'' page. 73 100 74 = Database operations and environmental nodes = 75 This service is available under the ”Files” menu. The service only works correctly if the process has the appropriate rights for files and directories. The file browser panel is located at the left side of the page. You can either browse files which are located on the server (”Browse server”), or which had been loaded into the database (”Browse loaded files”). You can switch between these two options from the drop-down located at the top of the browser. 101 == Database operations and environment nodes 76 102 77 == Browsing files on the server == 103 This service is available under the "Files" tab. It only works correctly if the server process has the appropriate access to files and directories. The file browser panel is located at the left side of the page. You can either browse files which are located on the server ("Browse server"), or which had been loaded into the database ("Browse loaded files"). You can switch between these two options from the drop-down located at the top of the tab. 104 105 === Browsing files on the server 106 78 107 The root directory of the browser is an optional configuration parameter. Possible values are: 79 108 80 * If the {{{browser_root}}} parameter is set during start up, the given value is the root directory. 81 * If the {{{browser_root}}} parameter is not set during start up, but the database had contained files before start up, the root elements are the directories of these files. 82 * If the {{{browser_root}}} parameter is not set during start up, and the database had not contained files before start up, then !RefactorErl’s lib directory will be the root directory. 109 * If the {{{browser_root}}} parameter is set during start up, the given value is the root directory. 110 * If the {{{browser_root}}} parameter is not set during start up 111 * If the database had contained files before start up, the root elements are the directories of these files. 112 * If the database had not contained files before start up, then !RefactorErl’s lib directory will be the root. 83 113 84 In this mode, directories can be listed, the contents of files can be shown, and a selected directory or file can be added to the database. The selected directory or file is shown by a blue background. Status messages are displayed during an addition to the database, and also after the process has finished.114 In this mode, directories can be listed, the contents of files can be shown, and a selected directory or file can be added to the database. The selected directory or file is highlighted by a blue background. Database operations are indicated by a progress bar. 85 115 86 == Browsing loaded files == 87 In this mode directories can be listed, contents files can be shown, a selected file or directory can be reloaded to the database, dropped from the database, or can be pre-generated for the sourcecode-viewer. Status messages are displayed during the reloading/dropping/generating process, and also after the process has finished. 116 === Browsing loaded files 88 117 89 Dropping a file does not delete it from the filesystem.118 In this mode, directories' and files' contents can be listed, a selected file or directory can be reloaded to the database, dropped from the database, or can be pre-generated for the source code viewer. Status messages are displayed during the reloading/dropping/generating process, and also after the process has finished. 90 119 91 == Environmental nodes == 92 ’Appbase’ environmental nodes can be listed, deleted or set here. 120 ''Dropping a file from the database does not imply removing it from the file system.'' 93 121 94 = Running semantic queries = 122 === Environment nodes 123 124 ’Appbase’ environment nodes can be listed, deleted or set here. 125 126 == Running semantic queries 95 127 96 128 See [wiki:WebInterface/RunningSemanticQueries Running semantic queries]. 97 129 98 = Errors = 99 This service is available under the ”Errors” menu. 130 == Errors 100 131 101 If database contains file(s) with error form(s), the list of errors will be displayed in a table. Each row in the table is equivalent to one error. File name and an error message are shown in the table. Clicking the filename shows the file and highlights the position the error is in. 132 This service is available under the "Errors" tab. 102 133 103 If the database does not contain any files with error forms, a ”No error” message is displayed.134 If the database contains file(s) with error form(s), the list of errors will be displayed in a table. Each row in the table shows an error. Clicking the file name shows the file and highlights the position of the error. 104 135 136 If the database does not contain any files with error forms, a "No error" message is displayed. 105 137 106 = Dependency examinations =138 == Dependency examination 107 139 108 140 See [wiki:WebInterface/DependencyExaminations Dependency examinations]. 109 141 110 142 111 = Logging out = 112 If the interface is no longer needed, the user can log out by clicking the ”Log out {{{username}}}” button. During the logout process the interface clears the users session, deletes the dynamically generated images, which belong to the user, and redirects the browser to the login page. The interface does not delete the queries executed by the user, nor their results, and also keeps the state of the database. 143 == Logging out 144 145 You can log out by clicking the "Log out {{{username}}}" button. During the logout process the interface clears the users' session, deletes the dynamically generated images belonging to the user, and redirects the browser to the login page. The interface does not delete the queries executed by the user, nor their results, and also keeps the state of the database.