Commit aa94fd245a464bc155f4a2711d67dd3e92c113dd

Authored by elena
1 parent 999065d1

Merge with last svn

.gitignore
... ... @@ -8,3 +8,4 @@ generic_data/newKernelDDBase/
8 8 js/lib/ext
9 9 help/simu/simu*
10 10 *~
  11 +
... ...
desktop.php
1 1 <?php
2 2 /**
3 3 * @file index.php
4   - * @version $Id: desktop.php 2915 2015-05-19 10:34:38Z elena $
5   - *
  4 + * @version $Id: desktop.php 2934 2015-06-03 13:23:22Z elena $
6 5 *
7 6 */
8   -
  7 +
  8 +
9 9 require_once('php/config.php');
10   -
  10 +
11 11 // error_reporting(E_ALL);
12 12 if (!isset($_POST['username'])) die('<a href="index.html">LOGIN SVP</a>');
13 13  
14 14 $usrMgr = new UserMgr();
15 15 $sessionID = $usrMgr->init();
16 16  
17   -
18 17 //AKKA - Delete immediate results is now done in AmdaApp.js
19 18 // ToDo : do the same mechanism for simu files and simuparams
20 19 //delete immediate results if logout was not proper
21 20 //$jobsMgr = new JobsMgr();
22 21 //$jobsMgr->deleteTmp();
23   -
24 22 //delete simu files & clean simuparams in base.xml and WSparam.xml
25 23 $myBaseMgr = new BaseManager();
26 24 $myBaseMgr->delSimuFiles("mywsrdata");
... ... @@ -48,15 +46,13 @@
48 46 <script type="text/javascript" src="js/lib/ext/ext-all-debug-w-comments.js"></script>
49 47 <!-- <script type="text/javascript" src="js/lib/ext/ext-all.js"></script> -->
50 48 <!-- <script type="text/javascript" src="js/lib/ext/ext-all-dev.js"> -->
51   - <script type="text/javascript" src="js/lib/ext-override.js"></script>
  49 + <script type="text/javascript" src="js/lib/ext-override.js"></script>
  50 +
52 51  
53 52  
54 53 <!-- Direct API -->
55 54 <script type="text/javascript" src="php/api.php"></script>
56 55  
57   - <!-- This extjs script is not automatically loaded (probably due to a bug on extjs 4) -->
58   - <!-- <script type="text/javascript" src="js/lib/ux/Browser.js"></script> -->
59   -
60 56  
61 57 <!-- <script src="help/movies/Resources/scripts/prototype.js" language="JavaScript" type="text/javascript"></script>
62 58 <script src="help/movies/Resources/scripts/qtp_poster.js" language="JavaScript" type="text/javascript"></script>
... ... @@ -93,7 +89,9 @@
93 89 var sessionID = '<?php echo $sessionID; ?>';
94 90 var isFirstVisit = '<?php echo $usrMgr->isFirst; ?>';
95 91 var isSpecialInfo = '<?php echo $usrMgr->isSpecialInfo; ?>';
96   - var isNewInfo = '<?php echo $usrMgr->isNewInfo; ?>';
  92 + var isNewInfo = '<?php echo $usrMgr->isNewInfo; ?>';
  93 + var news = '../data/' + sessionID + '/INFO';
  94 +
97 95 var AMDAVERSION = '<?php if (defined('AMDA_VERSION')) echo AMDA_VERSION;?>';
98 96  
99 97 var wsSize = '<?php echo $usrMgr->getWsSize(); ?>';
... ... @@ -102,7 +100,6 @@
102 100 var freeSpace = diskQuota - wsSize;
103 101  
104 102 var helpDir = 'help/';
105   -
106 103 var isGuest = sessionID.match('guest');
107 104  
108 105 var guestSessionDuration = '<?php echo GuestSessionDuration*60; ?>'; // in secs
... ... @@ -220,3 +217,4 @@
220 217 </head>
221 218 <body/>
222 219 </html>
  220 +
... ...
help/MAVEN 0 โ†’ 100644
... ... @@ -0,0 +1,19 @@
  1 +<h2>Mars Atmosphere and Volatile Evolution Mission (MAVEN)</h2>
  2 +MAVEN launched on November 18, 2013, and entered orbit around Mars on September 21, 2014.
  3 +The missionโ€™s goal is to explore the planetโ€™s upper atmosphere, ionosphere, and interactions
  4 +with the Sun and solar wind. Scientists will use MAVEN data to explore the loss of volatile
  5 +compoundsโ€”such as CO2, N2, and H2Oโ€”from the Martian atmosphere to space. Understanding atmospheric
  6 +loss will give scientists insight into the history of Mars' atmosphere and climate, liquid water,
  7 +and planetary habitability. <br/><br/>MAVEN Principal Investigator:
  8 +Dr. Bruce M. Jakosky (University of Colorado; Laboratory for Atmospheric and Space Physics).
  9 +<br/><br/>
  10 +For more information visit MAVEN <a href="http://lasp.colorado.edu/home/maven/" target="new">home page</a>.
  11 +<br/><br/>
  12 +MAVEN data in AMDA come from
  13 +<a href="http://ppi.pds.nasa.gov/search/?t=Mars&sc=MAVEN&i=null&title=Mars%20:%20MAVEN" target="new">
  14 +PDS/PPI</a>.
  15 +<br/><br/>
  16 +Please follow MAVEN
  17 +<a href="http://lasp.colorado.edu/home/maven/files/2014/09/MAVEN_public-rules-of-the-road-v3.pdf" target="new">
  18 +rules of the road</a> while using MAVEN data.
  19 +
0 20 \ No newline at end of file
... ...
help/mavenMAG 0 โ†’ 100644
... ... @@ -0,0 +1,8 @@
  1 +<h2>Magnetometer (MAG)</h2>
  2 +MAG is a part of the MAVEN Particles and Fields (P & F)
  3 +Package and measures interplanetary solar wind and ionospheric magnetic fields.<br/><br/>
  4 +
  5 +<a href="http://1.usa.gov/jecbio" target="new">Jack Connerney</a> (GSFC) is the instrument lead for the MAG.</br/><br/>
  6 +
  7 +For detailed information about MAG visit <a href="http://lasp.colorado.edu/home/maven/science/instrument-package/mag/" target="new">
  8 +MAG home page</a>
... ...
help/mavenSWEA 0 โ†’ 100644
... ... @@ -0,0 +1,7 @@
  1 +<h2>The Solar Wind Electron Analyzer (SWEA)</h2>
  2 +SWEA is a part of the MAVEN Particles and Fields (P & F) Package and measures the solar wind and ionospheric electrons.<br/><br/>
  3 +
  4 +<a href="http://bit.ly/dmitchellbio" target="new">David L. Mitchell</a> (SSL) is the instrument lead for SWEA.</br/><br/>
  5 +Christian Mazelle (IRAP) is responsible for hardware supply (electron spectrometer).</br/><br/>
  6 +For detailed information about SWEA visit <a href="http://lasp.colorado.edu/home/maven/science/instrument-package/swea/" target="new">
  7 +SWEA home page</a>
... ...
help/mavenSWIA 0 โ†’ 100644
... ... @@ -0,0 +1,9 @@
  1 +<h2>Solar Wind Ion Analyzer (SWIA)</h2>
  2 +The Solar Wind Ion Analyzer (SWIA) is a part of the MAVEN Particles and Fields (P & F)
  3 +Package and measures the solar wind and magnetosheath proton flow
  4 +around Mars and constrains the nature of solar wind interactions with the upper atmosphere.<br/><br/>
  5 +
  6 +The SWIA instrument lead is <a href="http://www.physics.uiowa.edu/~jhalekas" target="new">Jasper Halekas</a> (University of Iowa).
  7 +<br/><br/>
  8 +For detailed information about SWIA visit <a href="http://lasp.colorado.edu/home/maven/science/instrument-package/swia/" target="new">
  9 +SWIA home page</a>
... ...
help/parameters/PC 0 โ†’ 100644
... ... @@ -0,0 +1,32 @@
  1 +
  2 +<h2>Ground based indices at AMDA : Polar Cap Index </h2>
  3 +<UL>
  4 +
  5 + <li> Polar Cap Index (North and South) is taken from the
  6 + <a href="http://pc-index.org" TARGET=_BLANK>Polar Cap Magnetic Index Site</a>.
  7 +<P><br?>
  8 + The PC index is characteristic of the polar cap magnetic
  9 + activity generated by geoeffective solar wind acting on the magnetosphere.
  10 + The index is derived by magnetic data of only two stations Thule and Vostok located in
  11 +the northern (PCN) and southern (PCS) near-pole regions. In 2013 the International Association of
  12 +Geomagnetism and Aeronomy (IAGA) recommended to international scientific community to use PC index as a
  13 +proxy for energy that enters into the magnetosphere during solar wind โ€“ magnetosphere coupling.
  14 +The procedure adopted in AARI and DTU provides on-line calculation of the PCS and PCN
  15 +indices corresponding to geoeffective interplanetary electric field EKL value irrespective of time,
  16 +season and solar cycle.
  17 +<P><br/>
  18 +<i><b>IAGA Resolution No. 3 (2013)</b><br/>
  19 +Polar Cap (PC) index<br/><br/>
  20 +
  21 +IAGA, noting that polar cap magnetic activity is not yet described by existing IAGA geomagnetic indices,
  22 +considering that the Polar Cap (PC) index constitutes a quantitative estimate of geomagnetic activity at polar
  23 +latitudes and serves as a proxy for energy that enters into the magnetosphere during solar wind-magnetosphere
  24 +coupling, emphasising that the usefulness of such an index is dependent on having a continuous data series,
  25 +recognising that the PC index is derived in partnership between the Arctic and Antarctic Research Institute
  26 +(AARI, Russian Federation) and the National Space Institute, Technical University of Denmark (DTU, Denmark)
  27 +recommends use of the PC index by the international scientific community in its near-real time and definitive
  28 +forms, and urges that all possible efforts be made to maintain continuous operation of all geomagnetic
  29 +observatories contributing to the PC index.
  30 +</i>
  31 +</UL>
  32 +
... ...
help/policy.html
... ... @@ -21,11 +21,12 @@
21 21 <li><a href="http://spdf.gsfc.nasa.gov/new_users.html" target="_blank">CDAWEB</a>
22 22 <li><a href="http://ppi.pds.nasa.gov/citations_policy.jsp" target="_blank">PDS</a>
23 23 <li><a href="http://mapsview.engin.umich.edu/use_policy" target="_blank">MAPSKP</a>
24   - <li><a href="http://themis.ssl.berkeley.edu/roadrules.shtml" target="_blank">THEMIS</a>
  24 + <li><a href="http://themis.ssl.berkeley.edu/roadrules.shtml" target="_blank">THEMIS</a>
  25 + <li><a href="http://lasp.colorado.edu/home/maven/files/2014/09/MAVEN_public-rules-of-the-road-v3.pdf" target="_blank">MAVEN</a>
25 26 <li><a href="SKR.html">CASSINI/RPWS/SKR</a>
26 27 <li><a href="VEXGRAZ.html">VEXGRAZ</a>
27 28 <li><a href="http://caa.estec.esa.int/caa/ror.xml" target="_blank">CAA</a> / <a href="http://www.cosmos.esa.int/web/csa/rules-of-the-road" target="_blank">CSA</a>
28   - <li><a href="STEREO.html">STEREO</a>
  29 + <li><a href="STEREO.html">STEREO</a>
29 30 <li><a href="http://ccmc.gsfc.nasa.gov/PubPolicy.php" target="_blank">CCMC</a>
30 31 </ul>
31 32 </div>
... ... @@ -48,3 +49,4 @@ to remote centres, please follow the corresponding Rules of the Road.
48 49 </div>
49 50 </div></div></div>
50 51 </body></html>
  52 +
... ...
js/app/AmdaApp.js
... ... @@ -5,7 +5,7 @@
5 5 * @extends Ext.ux.desktop.App
6 6 * @brief Main class defining Amda Desktop and its Modules
7 7 * @author Ext JS Library 4.0 Copyright(c) 2006-2011 Sencha Inc. licensing@sencha.com
8   - * @version $Id: AmdaApp.js 2540 2014-10-03 09:22:29Z natacha $
  8 + * @version $Id: AmdaApp.js 2932 2015-06-02 09:35:47Z elena $
9 9 * @todo Load/Unload Modules on need
10 10 *******************************************************************************
11 11 * FT Id : Date : Name - Description
... ... @@ -159,6 +159,7 @@ Ext.define(&#39;amdaApp.AmdaApp&#39;, {
159 159 scope : this,
160 160 beforeunload : function ()
161 161 {
  162 +
162 163 var interopModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.interop.id);
163 164 if (interopModule)
164 165 interopModule.forceSampDisconnect();
... ... @@ -167,40 +168,8 @@ Ext.define(&#39;amdaApp.AmdaApp&#39;, {
167 168 ready : function ()
168 169 {
169 170 //AKKA - Clean user WS
170   - AmdaAction.cleanUserWS(function(res,e){},this);
171   -
172   - if (freeSpace < diskQuota / 20) {
173   - myDesktopApp.warningMsg('Think of cleaning up your work space.<br/>Only ' +
174   - Math.round(freeSpace/1024/1024)+ 'MB of '+Math.round(diskQuota/1024/1024) +
175   - 'MB rests');
176   - }
177   -
178   - if (isFirstVisit && !isGuest) {
179   - if (isSpecialInfo) {
180   - myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) {
181   - module.createWindow(isSpecialInfo, 'Welcome to AMDA', true);
182   - });
183   - } else {
184   - myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) {
185   - module.createWindow(isSpecialInfo, 'Welcome to AMDA', true);
186   - });
187   - }
188   - }
189   - else {
190   - if (isSpecialInfo) {
191   - myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) {
192   - module.createWindow(isSpecialInfo, 'Welcome to AMDA', true);
193   - });
194   - }
195   - }
196   - if (isGuest) {
197   - myDesktopApp.warningMsg("Welcome to Guest Session<br/>Guest session lasts for "+
198   - guestSessionDuration/3600+" h maximum<br/>"+
199   - "For extended use time and functionalities (saved sessions)<br/> please register at amda@irap.omp.eu");
200   - Ext.Function.defer(myDesktopApp.warningMsg,(guestSessionDuration-300)*1000, this, ["Your session will be closed in 5 min!"]);
201   - Ext.Function.defer(myDesktopApp.forceLogout, guestSessionDuration*1000);
202   - }
203   - }
  171 + AmdaAction.cleanUserWS(function(res,e){},this);
  172 + }
204 173 },
205 174  
206 175 init: function() {
... ... @@ -294,9 +263,7 @@ Ext.define(&#39;amdaApp.AmdaApp&#39;, {
294 263 if (!wallpaper)
295 264 wallpaper = 'js/resources/images/desktop/wallpapers/Cdpp2.jpg';
296 265 return Ext.apply(ret, {
297   - id : desktopId,
298   - // cls: 'ux-desktop-black', // TODO: investigate about uncomplete theme application !!!
299   -
  266 + id : desktopId,
300 267 contextMenuItems: [
301 268 { text: 'Change Settings', handler: me.onSettings, scope: me }
302 269 ],
... ... @@ -306,13 +273,14 @@ Ext.define(&#39;amdaApp.AmdaApp&#39;, {
306 273 data: [
307 274 { name: 'Help', iconCls: 'help', module: 'help-win' },
308 275 { name: 'Create/Modify parameter', iconCls: 'edit', module: 'param-win' },
309   - { name: 'Plotting data', iconCls: 'plot', module: 'plot-win'},
  276 + { name: 'Plot data', iconCls: 'plot', module: 'plot-win'},
310 277 { name: 'Data mining', iconCls: 'search', module: 'search-win'},
311 278 { name: 'Download data', iconCls: 'download_manager', module: 'down-win'},
312 279 { name: 'Upload data', iconCls: 'mydata', module: 'up-win'},
313   - { name: 'Manage Time Tables', iconCls: 'timeTable', module: 'timetab-win' },
314   - { name: 'TimeTables Operations', iconCls: 'operations', module: 'ttsOpe-win' },//,
315   - // { name: 'My catalogs', iconCls: 'catalog', module: 'catalog-win'},
  280 + { name: 'Manage TimeTables', iconCls: 'timeTable', module: 'timetab-win' },
  281 + { name: 'TimeTables operations', iconCls: 'operations', module: 'ttsOpe-win' },
  282 + // { name: 'Generate/Edit catalogs', iconCls: 'catalog', module: 'catalog-win'},
  283 + // { name: 'Visualize catalogs', iconCls: 'visu_catalog', module: 'visucatalog-win'},
316 284 { name: 'Interoperability', iconCls: 'interop', module: 'interop-win' }
317 285 ]
318 286 }),
... ... @@ -325,7 +293,6 @@ Ext.define(&#39;amdaApp.AmdaApp&#39;, {
325 293 // config for the start menu
326 294 getStartConfig : function() {
327 295 var me = this, ret = me.callParent();
328   -
329 296 return Ext.apply(ret, {
330 297 title: sessionID,
331 298 iconCls: 'icon-user',
... ... @@ -460,7 +427,6 @@ Ext.define(&#39;amdaApp.AmdaApp&#39;, {
460 427  
461 428 getTaskbarConfig: function () {
462 429 var ret = this.callParent();
463   -
464 430 return Ext.apply(ret, {
465 431 quickStart: [],
466 432 trayItems: [
... ... @@ -636,12 +602,48 @@ Ext.define(&#39;amdaApp.AmdaApp&#39;, {
636 602 module.createWindow();
637 603 });
638 604 }, this);
  605 +
  606 + if (freeSpace < diskQuota / 20) {
  607 + myDesktopApp.warningMsg('Think of cleaning up your work space.<br/>Only ' +
  608 + Math.round(freeSpace/1024/1024)+ 'MB of '+Math.round(diskQuota/1024/1024) +
  609 + 'MB rests');
  610 + }
  611 +
  612 + if (isFirstVisit && !isGuest) {
  613 + if (isSpecialInfo) {
  614 + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) {
  615 + module.createWindow(isSpecialInfo, 'Welcome to AMDA', true);
  616 + });
  617 + } else {
  618 +
  619 + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.help.id, true, function(module) {
  620 + module.createWindow();
  621 + });
  622 + }
  623 + }
  624 + else {
  625 + if (isSpecialInfo && !isNewInfo) {
  626 + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) {
  627 + module.createWindow(isSpecialInfo, 'Welcome to AMDA', true);
  628 + });
  629 + }
  630 + }
639 631  
640   - if (isNewInfo) {
641   - this.getLoadedModule(this.dynamicModules.info.id, true, function (module) {
642   - module.createWindow('releaseNotes.' + AMDAVERSION, 'New Release V'+ AMDAVERSION);
643   - });
  632 + if (isNewInfo) {
  633 + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) {
  634 + // module.createWindow('releaseNotes.' + AMDAVERSION, 'New Release V'+ AMDAVERSION);
  635 + module.createWindow(news, 'Amda Latest News');
  636 + });
  637 + }
  638 +
  639 + if (isGuest) {
  640 + myDesktopApp.warningMsg("Welcome to Guest Session<br/>Guest session lasts for "+
  641 + guestSessionDuration/3600+" h maximum<br/>"+
  642 + "For extended use time and functionalities (saved sessions)<br/> please register at amda@irap.omp.eu");
  643 + Ext.Function.defer(myDesktopApp.warningMsg,(guestSessionDuration-300)*1000, this, ["Your session will be closed in 5 min!"]);
  644 + Ext.Function.defer(myDesktopApp.forceLogout, guestSessionDuration*1000);
644 645 }
  646 +
645 647  
646 648  
647 649 this.desktop.taskbar.tray.width = 130;
... ... @@ -654,3 +656,4 @@ Ext.define(&#39;amdaApp.AmdaApp&#39;, {
654 656 }}));
655 657 }
656 658 });
  659 +
... ...
js/app/models/DownloadNode.js
... ... @@ -5,12 +5,7 @@
5 5 * @extends amdaModel.ExecutableNode
6 6 * @brief Basic Model of Node corresponding to a download request
7 7 * @author Myriam
8   - * @version $Id: DownloadNode.js 2640 2014-11-18 11:57:25Z elena $
9   - * @todo
10   - *******************************************************************************
11   - * FT Id : Date : Name - Description
12   - *******************************************************************************
13   - * : 15/12/2011 - file creation
  8 + * @version $Id: DownloadNode.js 2949 2015-06-23 10:25:59Z elena $
14 9 */
15 10 //TODO amdaModel.SingletonNode class ???
16 11 Ext.define('amdaModel.DownloadNode', {
... ... @@ -37,12 +32,7 @@ Ext.define(&#39;amdaModel.DownloadNode&#39;, {
37 32 getObjectCallback : function(result,remoteEvent){
38 33 var t = remoteEvent.getTransaction();
39 34 if (result) {
40   - // var reader = Ext.create('Ext.data.reader.Json',{
41   - // model: this.get('objectDataModel')
42   - // });
43   - // var resultSet = reader.read(result);
44   - // var paramObj = resultSet.records[0];//
45   - var paramObj = Ext.create(this.get('objectDataModel'), result);
  35 + var paramObj = Ext.create(this.get('objectDataModel'), result);
46 36 // set parameter into node
47 37 this.set('object', paramObj);
48 38 var downObject = amdaModel.DownloadNode.decodeObject();
... ... @@ -156,7 +146,6 @@ Ext.define(&#39;amdaModel.DownloadNode&#39;, {
156 146 parseArgs: function(param) {
157 147 var name = param.name;
158 148 var args = param.downloadParamArgs;
159   -
160 149 if (args.energyMax){
161 150 var nameToSent = name + '_' + args.energyMin + '_' + args.energyMax;
162 151 return nameToSent;
... ... @@ -184,6 +173,11 @@ Ext.define(&#39;amdaModel.DownloadNode&#39;, {
184 173 if (args.SW_Monitor) {
185 174 var nameToSent = name + '_' + args.Spacecraft + '_' + args.SW_Monitor;
186 175 return nameToSent;
  176 + }
  177 + // Cain ; Morschhauser
  178 + if (args.Spacecraft && args.Sampling) {
  179 + var nameToSent = name + '_' + args.Spacecraft + '_' + args.Sampling;
  180 + return nameToSent;
187 181 }
188 182 // LATMOS
189 183 if (args.ClockAngle && args.Satellite) {
... ... @@ -235,7 +229,7 @@ Ext.define(&#39;amdaModel.DownloadNode&#39;, {
235 229 AmdaAction.execute({nodeType : this.get('nodeType')}, jsonObject, function(res,e){
236 230  
237 231 loadMask.hide();
238   -
  232 +
239 233 //AKKA - Rework of the result treatment for the integration with the new kernel
240 234 if (!e.status)
241 235 {
... ... @@ -287,6 +281,7 @@ Ext.define(&#39;amdaModel.DownloadNode&#39;, {
287 281 var obj = this.get('object').getJsonValues();
288 282 //TODO text, name, outputName - if all is needed
289 283 //new object to attach to new bkgJobNode
  284 +
290 285 //TODO Ext.clone()
291 286  
292 287 var newobj = Ext.copyTo({}, obj, this.get('object').propertiesToCopy);
... ... @@ -294,7 +289,6 @@ Ext.define(&#39;amdaModel.DownloadNode&#39;, {
294 289 newobj.resultId = res.result;
295 290 newobj.folderId = res.folder;
296 291 newobj = Ext.create(this.get('object').$className, newobj);
297   -
298 292 return newobj;
299 293 }
300 294  
... ...
js/lib/ux/desktop/exampleModules/Settings.js
... ... @@ -106,7 +106,8 @@ Ext.define(&#39;MyDesktop.Settings&#39;, {
106 106 child('Cdpp2.jpg'),
107 107 child('sky.jpg'),
108 108 child('rosetta.jpg'),
109   - child('rosetta2.jpg')
  109 + child('rosetta2.jpg'),
  110 + child('SObackground.png')
110 111 ]
111 112 }
112 113 })
... ...
js/resources/images/desktop/wallpapers/SObackground.png 0 โ†’ 100644

154 KB

php/classes/AmdaAction.php
1 1 <?php
2 2 /**
3 3 * @class AmdaAction
4   - * @version $Id: AmdaAction.php 2333 2014-04-30 10:38:02Z elena $
  4 + * @version $Id: AmdaAction.php 2976 2015-07-01 15:05:40Z benjamin $
5 5 *
6 6 */
7 7  
... ... @@ -16,11 +16,13 @@ class AmdaAction {
16 16 'bkgWorks' => 'jobs.xml');
17 17  
18 18 private $user, $amdaStat;
19   -
  19 +
20 20 public function __construct()
21   - {
22   - if (!defined('NEWKERNEL_DEBUG') || !NEWKERNEL_DEBUG)
23   - $this->amdaStat = new AmdaStats();
  21 + {
  22 + $dd = new UserMgr();
  23 + $this->user = $dd->user;
  24 + if (!defined('NEWKERNEL_DEBUG') || !NEWKERNEL_DEBUG)
  25 + $this->amdaStat = new AmdaStats($dd->user);
24 26 }
25 27  
26 28 private function getUrlDirs($url) {
... ... @@ -292,10 +294,12 @@ class AmdaAction {
292 294  
293 295 }
294 296  
  297 + //TODO proper conditions
295 298 if (substr($id,0,3) == 'ros')
296 299 {
297 300 if ( !(strpos($id,'_r_') || strpos($id,'_xyz_') || strpos($id,'_cg_')
298   - || strpos($id,'_sc_') || strpos($id,'_aux_')) )
  301 + || strpos($id,'_sc_') || strpos($id,'_aux_') || strpos($id,'_sw_')
  302 + || strpos($id,'_tao_') ))
299 303 {
300 304 $not_yet = true;
301 305 }
... ... @@ -550,6 +554,7 @@ class AmdaAction {
550 554 return array("error" => $nodeType." NOT_IMPLEMENTED_YET");
551 555 }
552 556 return $objectMgr -> getUploadedObject($name, $format, true);
  557 +
553 558 }
554 559  
555 560 /*
... ... @@ -571,6 +576,7 @@ class AmdaAction {
571 576 * temporary object from Search
572 577 */
573 578 public function getTmpObject($folderId, $name, $nodeType) {
  579 +
574 580  
575 581 switch ($nodeType) {
576 582 case 'timeTable' :
... ... @@ -580,6 +586,7 @@ class AmdaAction {
580 586 return array("error" => $nodeType." NOT_IMPLEMENTED_YET");
581 587 }
582 588 return $objectMgr -> getTmpObject($folderId, $name, true);
  589 +
583 590 }
584 591  
585 592  
... ... @@ -636,6 +643,7 @@ class AmdaAction {
636 643 case 'bkgWorks' :
637 644 require_once(INTEGRATION_SRC_DIR."RequestManager.php");
638 645 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSDELETE);
  646 +
639 647 case 'myData' :
640 648 $objectMgr = new FilesMgr();
641 649 break;
... ... @@ -728,8 +736,7 @@ class AmdaAction {
728 736 }
729 737  
730 738 return $objectMgr -> modifyObject($obj);
731   - }
732   -
  739 + }
733 740 /*
734 741 * {obj.name, obj.nodeType, obj.leaf}
735 742 */
... ... @@ -756,6 +763,7 @@ class AmdaAction {
756 763 /*
757 764 * Get Jobs en cours
758 765 */
  766 +
759 767 public function getJobs()
760 768 {
761 769 require_once(INTEGRATION_SRC_DIR."RequestManager.php");
... ... @@ -913,7 +921,6 @@ class AmdaAction {
913 921  
914 922 return $result;
915 923 }
916   -
917 924 public function initTTCache()
918 925 {
919 926 $cacheMgr = new TimeTableCacheMgr();
... ... @@ -991,7 +998,7 @@ class AmdaAction {
991 998 $cacheMgr = new TimeTableCacheMgr();
992 999 return $cacheMgr->getStatus();
993 1000 }
994   -
  1001 +
995 1002 /*
996 1003 * Send a feedback
997 1004 *
... ... @@ -1190,8 +1197,7 @@ class AmdaAction {
1190 1197  
1191 1198 $res = array('success' => true,'addedRuns' => $obj);
1192 1199 return $res;
1193   - }
1194   -
  1200 + }
1195 1201 //AKKA - New action to clean user WS
1196 1202 public function cleanUserWS()
1197 1203 {
... ... @@ -1207,3 +1213,4 @@ class AmdaAction {
1207 1213 }
1208 1214 }
1209 1215 ?>
  1216 +
... ...
php/classes/AmdaClient.php
1 1 <?php
2 2  
3 3 /** @class AmdaClient
4   - * @version $Id: AmdaClient.php 2322 2014-04-26 12:36:49Z elena $
  4 + * @version $Id: AmdaClient.php 2888 2015-04-29 15:25:42Z elena $
5 5 * @brief Client of DD Web Server
6 6 *
7 7 */
... ... @@ -24,7 +24,6 @@ class AmdaClient {
24 24 * DDServer is defined in DD.res
25 25 */
26 26 $SERVER = file($DDPATH."/DD.res");
27   -
28 27 if (!file_exists(DATAPATH."wsdl.location")) {
29 28 $msg = "No WSDL location file -> Nothing done".PHP_EOL;
30 29 error_log($msg, 1, email);
... ... @@ -769,3 +768,4 @@ class AmdaClient {
769 768 }
770 769 */
771 770 }
  771 +
... ...
php/classes/AmdaNews.php 0 โ†’ 100644
... ... @@ -0,0 +1,122 @@
  1 +<?php
  2 +/**
  3 + * @class AmdaNews
  4 + * @version $Id: AmdaNews.php 2957 2015-06-25 13:40:38Z elena $
  5 + *
  6 + */
  7 +
  8 +class AmdaNews {
  9 +
  10 + public $user, $userdir, $infodir;
  11 +
  12 + public function __construct($user) {
  13 + if ($user) {
  14 + $this->user = $user;
  15 + $this->userdir = USERPATH."/".$user."/";
  16 + $this->infodir = HELPPATH."INFO/";
  17 + }
  18 + }
  19 +
  20 +/**
  21 +* Add new info message and mark user dir with newInfo file
  22 +*/
  23 + public function addInfo($group){
  24 +
  25 + // special dir for group news
  26 + if ($group) $this->infodir = BASE_PATH.'help/'.$group.'_INFO/';
  27 + else $this->infodir = BASE_PATH.'help/INFO/';
  28 +
  29 + $timeStamp = time();
  30 + $stringDate = date("Y-m-d",$timeStamp);
  31 +
  32 + if (!is_dir($this->infodir)) mkdir($this->infodir);
  33 +
  34 + $ff = fopen($this->infodir.'info.'.$timeStamp,'w');
  35 + $infoToWrite = $_POST['info'];
  36 +
  37 + if (strpos($infoToWrite,"<a href=") !== false) {
  38 + $infoToWrite = str_replace("<a href=","<a target='new' href=", $infoToWrite);
  39 + }
  40 + fwrite($ff,'<li><b>'.$stringDate.'</b><br/>'.$infoToWrite.PHP_EOL);
  41 + fclose($ff);
  42 +
  43 + $userDir = BASE_PATH."data/";
  44 +
  45 + $users = glob($userDir."*");
  46 + foreach ($users as $user) {
  47 +
  48 + $file = $user.'/newInfo';
  49 + touch($file);
  50 + chmod($file, 0775);
  51 + }
  52 +
  53 + return array("msg" => "New Info is saved", "success" => true);
  54 +
  55 + }
  56 +
  57 +/**
  58 +* Concate individual info messages inti one to be shown to user
  59 +*/
  60 + public function makeInfo($groups){
  61 +
  62 + if (file_exists($this->userdir.'lastLogin')) {
  63 +
  64 + $timeStamp = filemtime($this->userdir.'lastLogin');
  65 +
  66 + $ff = fopen($this->userdir.'INFO','w');
  67 + fwrite($ff,'<IMG align="right" SRC="help/images/picto_amda.png"/><br/><h2>AMDA Latest News</h2><br/>');
  68 + fclose($ff);
  69 +
  70 + $userGrps = explode(',',strtoupper($groups));
  71 +
  72 + foreach ($userGrps as $grp) {
  73 + if (is_dir(HELPPATH.$grp."_INFO")) {
  74 + $grpDir = HELPPATH.$grp."_INFO/";
  75 + $grpInfoFiles = glob($grpDir."info*");
  76 + $grpFileList = array();
  77 +
  78 + foreach ($grpInfoFiles as $file) {
  79 + $grpFileList[filemtime($file)] = $file;
  80 + }
  81 +
  82 + ksort($grpFileList);
  83 + $grpFileList = array_reverse($grpFileList, TRUE);
  84 +
  85 + foreach ($grpFileList as $info) {
  86 + if (filemtime($info) > $timeStamp) {
  87 + file_put_contents($this->userdir.'INFO', file_get_contents($info), FILE_APPEND);
  88 + $NN++;
  89 + }
  90 + }
  91 + }
  92 + }
  93 +
  94 + $publicInfoFiles = glob($this->infodir."info*");
  95 + $fileList = array();
  96 +
  97 + foreach ($publicInfoFiles as $file) {
  98 + $fileList[filemtime($file)] = $file;
  99 + }
  100 +
  101 + ksort($fileList);
  102 + $fileList = array_reverse($fileList, TRUE);
  103 +
  104 + $NN = 0;
  105 +
  106 + foreach ($fileList as $info) {
  107 + if (filemtime($info) > $timeStamp) {
  108 + file_put_contents($this->userdir.'INFO', file_get_contents($info), FILE_APPEND);
  109 + $NN++;
  110 + }
  111 + }
  112 +
  113 + if ($NN == 0) {
  114 + unlink($this->userdir.'INFO'); // No news
  115 + return 0;
  116 + }
  117 + else return 1;
  118 + }
  119 + else return 0;
  120 + }
  121 +}
  122 +?>
... ...
php/classes/AmdaStats.php
1 1 <?php
2 2 /**
3 3 * @class AmdaStats
4   - * @version $Id: AmdaStats.php 2716 2015-01-19 13:22:05Z elena $
  4 + * @version $Id: AmdaStats.php 2964 2015-06-26 07:53:48Z elena $
5 5 *
6 6 */
7 7  
... ... @@ -24,7 +24,7 @@ class AmdaStats {
24 24 if (!$user){
25 25 // general - to read
26 26 define('StatsXml',DATAPATH.'Statistics/Stats.xml');
27   - if (file_exists(StatsXml)) unlink(StatsXml);
  27 + // if (file_exists(StatsXml)) unlink(StatsXml);
28 28 }
29 29 else {
30 30 // individual - to write
... ... @@ -69,7 +69,6 @@ class AmdaStats {
69 69 $doc2 = new DomDocument("1.0");
70 70  
71 71 $users=glob(USERPATH."*");
72   -
73 72 foreach ($users as $user) {
74 73 $name2 = $user."/Stats.xml";
75 74  
... ... @@ -89,7 +88,12 @@ class AmdaStats {
89 88 }
90 89 }
91 90 }
92   -
  91 +
  92 + // write task statistics as json
  93 + $this->getModulesStat(null,null,true);
  94 + // write data statistics as json
  95 + $this->getDataStat(0,null,null,true);
  96 +
93 97 return $this->statXml->save(StatsXml);
94 98  
95 99 }
... ... @@ -189,7 +193,12 @@ class AmdaStats {
189 193 /*
190 194 * Show Statistics
191 195 */
192   - public function getModulesStat($start, $stop){
  196 + public function getModulesStat($start, $stop, $update){
  197 +
  198 +
  199 + if (!$update && file_exists(DATAPATH.'Statistics/tasks.json')) {
  200 + return file_get_contents(DATAPATH.'Statistics/tasks.json');
  201 + }
193 202  
194 203 $taskArray = array();
195 204  
... ... @@ -199,90 +208,100 @@ class AmdaStats {
199 208 $hints = $items->length;
200 209  
201 210 $startStop = $this->getStartStop($items, $start, $stop);
202   -
203 211 $taskArray[] = array('task' => $task, 'number' => $hints,
204   - 'start' => $startStop[0], 'stop' => $startStop[1]);
  212 + 'start' => $startStop[0], 'stop' => $startStop[1]);
205 213 }
206   -
207   - $objToReturn = array('stats' => $taskArray);
  214 +
  215 + $objToReturn = json_encode(array('stats' => $taskArray));
  216 +
  217 + file_put_contents(DATAPATH.'Statistics/tasks.json', $objToReturn);
  218 +
208 219 return $objToReturn;
209 220 }
210 221  
211 222 /*
212 223 * Show Statistics
213 224 */
214   - public function getDataStat($index, $start, $stop){
  225 + public function getDataStat($index, $start, $stop, $update){
215 226  
216   - $VIarray = array();
217   - $TOTALarray = array();
218   - $STARTarray = array();
219   - $STOParray = array();
220 227  
221   - foreach ($this->tasks as $task) {
  228 + if (!$update && file_exists(DATAPATH.'Statistics/data.json')) {
  229 + $GENERALarray = json_decode(file_get_contents(DATAPATH.'Statistics/data.json'));
  230 + }
  231 + else {
  232 + $VIarray = array();
  233 + $TOTALarray = array();
  234 + $STARTarray = array();
  235 + $STOParray = array();
222 236  
223   - $theTask = $this->statXml->getElementsByTagName($task)->item(0);
224   - $items = $theTask->getElementsByTagName('item');
225   - $TASKarray = array();
226   -
227   - foreach ($items as $item){
228   -
229   - $VIs = $item->getElementsByTagName('dataset');
230   - $time = strtotime($item->getAttribute('date'));
231   -
232   - foreach ($VIs as $VI) {
233   - $id = $VI->nodeValue;
234   - if ($id) {
235   - if ($TASKarray[$id]) {
236   - $TASKarray[$id]++;
237   - $TOTALarray[$id]++;
238   - if ($STARTarray[$id] > $time)
239   - $STARTarray[$id] = $time;
240   - if ($STOParray[$id] < $time)
241   - $STOParray[$id] = $time;
242   - }
243   - else {
244   - if (!$TOTALarray[$id]) {
245   - $STARTarray[$id] = $time;
246   - $STOParray[$id] = $time;
247   - $TOTALarray[$id] = 1;
248   - }
249   - else {
250   - if ($STARTarray[$id] > $time)
  237 + foreach ($this->tasks as $task) {
  238 +
  239 + $theTask = $this->statXml->getElementsByTagName($task)->item(0);
  240 + $items = $theTask->getElementsByTagName('item');
  241 + $TASKarray = array();
  242 +
  243 + foreach ($items as $item){
  244 +
  245 + $VIs = $item->getElementsByTagName('dataset');
  246 + $time = strtotime($item->getAttribute('date'));
  247 +
  248 + foreach ($VIs as $VI) {
  249 + $id = $VI->nodeValue;
  250 + if ($id) {
  251 + if ($TASKarray[$id]) {
  252 + $TASKarray[$id]++;
  253 + $TOTALarray[$id]++;
  254 + if ($STARTarray[$id] > $time)
251 255 $STARTarray[$id] = $time;
252   - if ($STOParray[$id] < $time)
  256 + if ($STOParray[$id] < $time)
253 257 $STOParray[$id] = $time;
254   - $TOTALarray[$id]++;
255   - }
256   - $TASKarray[$id] = 1;
257   - }
258   - }
  258 + }
  259 + else {
  260 + if (!$TOTALarray[$id]) {
  261 + $STARTarray[$id] = $time;
  262 + $STOParray[$id] = $time;
  263 + $TOTALarray[$id] = 1;
  264 + }
  265 + else {
  266 + if ($STARTarray[$id] > $time)
  267 + $STARTarray[$id] = $time;
  268 + if ($STOParray[$id] < $time)
  269 + $STOParray[$id] = $time;
  270 + $TOTALarray[$id]++;
  271 + }
  272 + $TASKarray[$id] = 1;
  273 + }
  274 + }
  275 + }
  276 + }
  277 + $VIarray[$task] = $TASKarray;
259 278 }
260   - }
261   - $VIarray[$task] = $TASKarray;
262   - }
263   -
264   - $GENERALarray = array();
265   - arsort($TOTALarray);
266   -
267   - foreach ($TOTALarray as $key => $value) {
268   - $viStart = $STARTarray[$key];
269   - $viStop = $STOParray[$key];
270   - $plot = $VIarray['plot'][$key];
271   - $mining = $VIarray['mining'][$key];
272   - $print = $VIarray['print'][$key];
273   - if ($key != 'undefined')
274   - {
275   - $GENERALarray[] = array('id' => $key, 'number' => $value,
276   - 'plot' => $plot, 'mining' => $mining,
277   - 'print' => $print, 'start' => $viStart,
278   - 'stop' => $viStop);
279   - }
280   - }
281   -
  279 +
  280 + $GENERALarray = array();
  281 + arsort($TOTALarray);
  282 +
  283 + foreach ($TOTALarray as $key => $value) {
  284 + $viStart = $STARTarray[$key];
  285 + $viStop = $STOParray[$key];
  286 + $plot = $VIarray['plot'][$key];
  287 + $mining = $VIarray['mining'][$key];
  288 + $print = $VIarray['print'][$key];
  289 + if ($key != 'undefined')
  290 + {
  291 + $GENERALarray[] = array('id' => $key, 'number' => $value,
  292 + 'plot' => $plot, 'mining' => $mining,
  293 + 'print' => $print, 'start' => $viStart,
  294 + 'stop' => $viStop);
  295 + }
  296 + }
  297 + }
  298 +
282 299 $Nmax = count($GENERALarray);
283 300  
284 301 $length = $index + 20 > $Nmax ? $Nmax - $index + 1 : 20;
285 302 $objToReturn = array('stats' => array_reverse(array_slice($GENERALarray, $index, $length)));
  303 +
  304 + file_put_contents(DATAPATH.'Statistics/data.json',json_encode($GENERALarray));
286 305 // $objToReturn = array('stats' => $GENERALarray);
287 306 return $objToReturn;
288 307 }
... ... @@ -302,6 +321,37 @@ class AmdaStats {
302 321  
303 322 return array(min($date), max($date));
304 323 }
  324 +
  325 + public function mergeStats($inXml) {
  326 +
  327 +
  328 + if (!file_exists(StatsXml)) return 0;
  329 +
  330 + if (!file_exists($inXml)) return 0;
  331 +
  332 + $tags = array_merge($this->tasks,$this->tasksAdd);
  333 +
  334 + $doc1 = new DomDocument("1.0");
  335 + $doc2 = new DomDocument("1.0");
  336 +
  337 + if (!$doc1->load(StatsXml)) return 0;
  338 + if (!$doc2->load($inXml)) return 0;
  339 +
  340 + foreach ($tags as $tag){
305 341  
  342 + $tag1 = $doc1->getElementsByTagName($tag)->item(0);
  343 + $tag2 = $doc2->getElementsByTagName($tag)->item(0);
  344 + $items2 = $tag2->getElementsByTagName("item");
  345 + if ($items2->length > 0) {
  346 + foreach ($items2 as $item2) {
  347 + $item1 = $doc1->importNode($item2, true);
  348 + $tag1->appendChild($item1);
  349 + }
  350 + }
  351 + }
  352 +
  353 + return $doc1->save(StatsXml);
  354 +
  355 + }
306 356 }
307 357 ?>
... ...
php/classes/SimuArgsMgr.php
... ... @@ -98,7 +98,7 @@
98 98 case 'SINP':
99 99 if ($this->simulatedRegion == 'Mercury.Magnetosphere'){
100 100 $grp[] = array("group" => "BD", "args" => array("value" => "-196.0"));
101   - $grp[] = array("group" => "Flux", "args" => array("value" => "131.0"));
  101 + $grp[] = array("group" => "Flux", "args" => array("value" => "4.0"));
102 102 $grp[] = array("group" => "Rss", "args" => array("value" => "1.35"));
103 103 $grp[] = array("group" => "R2", "args" => array("value" => "1.32"));
104 104 $grp[] = array("group" => "DZ", "args" => array("value" => "0.0"));
... ...
php/classes/SimuParamMgr.php
... ... @@ -380,4 +380,5 @@
380 380 }
381 381  
382 382 }
383   -?>
384 383 \ No newline at end of file
  384 +?>
  385 +
... ...
php/classes/UserMgr.php
1 1 <?php
2 2 /**
3 3 * @class UserMgr
4   - * @version $Id: UserMgr.php 2820 2015-03-18 06:46:57Z elena $
  4 + * @version $Id: UserMgr.php 2926 2015-06-01 14:01:53Z elena $
5 5 *
6 6 */
7 7  
... ... @@ -70,8 +70,6 @@ define(&#39;JOBPATH&#39;, USERPATH.&#39;jobs/&#39;);
70 70 $this->user = $_GET['sessionID'];
71 71 else if (isset($sessionID))
72 72 $this->user = $sessionID;
73   -
74   -
75 73 $this->amdaClient = new AmdaClient();
76 74 }
77 75  
... ... @@ -81,7 +79,8 @@ define(&#39;JOBPATH&#39;, USERPATH.&#39;jobs/&#39;);
81 79  
82 80 }
83 81  
84   - public function getIPclient(){
  82 +
  83 + public function getIPclient(){
85 84  
86 85 /*
87 86 REMOTE_ADDR is the only really reliable information,
... ... @@ -113,7 +112,7 @@ define(&#39;JOBPATH&#39;, USERPATH.&#39;jobs/&#39;);
113 112 protected function getAvailableMissionsByUser()
114 113 {
115 114 $res = $this->amdaClient->getUserAvailableMissions($this->user);
116   -
  115 +
117 116 if (!$res['success'])
118 117 return array('local' => array(), 'external' => array());
119 118 return array('local' => $res['local'], 'external' => $res['external']);
... ... @@ -294,7 +293,6 @@ define(&#39;JOBPATH&#39;, USERPATH.&#39;jobs/&#39;);
294 293 else $nodeNew->setAttribute('rank', 999);
295 294 }
296 295 }
297   -
298 296 $Amda->appendChild($nodeNew);
299 297 }
300 298 }
... ... @@ -608,13 +606,31 @@ define(&#39;JOBPATH&#39;, USERPATH.&#39;jobs/&#39;);
608 606 $this->isFirst = true;
609 607 }
610 608  
611   - // if new info exists it will be shown to each user
  609 + if (file_exists($this->userdir.'newLogin')) {
  610 + copy($this->userdir.'newLogin',$this->userdir.'lastLogin');
  611 + $dt = filemtime($this->userdir.'newLogin');
  612 + touch($this->userdir.'lastLogin', $dt);
  613 + }
  614 + else
  615 + touch($this->userdir.'lastLogin', time() - 5*86400); // last 5 days
  616 +
  617 + // if new info exists it will be shown to :
  618 + // public => to all
  619 + // special => to group members
612 620 if (file_exists($this->userdir.'newInfo'))
613   - {
614   - $this->isNewInfo = true;
  621 + {
  622 + $amdaInfo = new AmdaNews($this->user);
  623 + // if status = 0 - it is special info to group members only
  624 + // else to all
  625 + $info = $this->getUserInfo($this->user);
  626 + $status = $amdaInfo->makeInfo($info['group']);
  627 +
  628 + if ($status) $this->isNewInfo = true;
  629 +
615 630 unlink($this->userdir.'newInfo');
616 631 }
617   -
  632 + touch($this->userdir.'newLogin');
  633 +
618 634 $this->setPath();
619 635  
620 636 $this->userMissions = $this->getAvailableMissionsByUser();
... ...
php/classes/WebServer.php
... ... @@ -2,9 +2,8 @@
2 2 /**
3 3 * @file WebServer.php
4 4 * @brief Web services AMDA
5   -*
6   -*
7   -* @version $Id: WebServer.php 2879 2015-04-29 11:47:52Z myriam $
  5 +*
  6 +* @version $Id: WebServer.php 2968 2015-06-29 13:17:00Z natacha $
8 7 */
9 8 class WebResultMgr
10 9 {
... ... @@ -423,9 +422,24 @@ class WebServer
423 422 $cmd = DDBIN."DD_Plot request.list ".$this->userID." ".$this->IP." ".DDPROJECT." ".DDPROJLIB;
424 423 $reqMgr = new RequestMgr();
425 424 $pid = $reqMgr->background($cmd);
426   - sleep(1);
427   - $plotWSresult=WSRESULT.$ID."/request.list.png";
428   - return array('success' => true, 'plotFileURL' => 'http://'.str_replace(BASE_PATH,$_SERVER['SERVER_NAME'].APACHE_ALIAS,$plotWSresult));
  425 +
  426 +
  427 + return array('success' => true, 'plotDirectoryURL' => $ID);
  428 + }
  429 +
  430 + public function getResultPlot($data) {
  431 +
  432 + $res = $this->init($data);
  433 + $vars = $res['vars'];
  434 + $ID = $vars["plotDirectoryURL"];
  435 + $filename = WSRESULT.$ID."/request.list.png";
  436 + if (file_exists($filename)) {
  437 + $plotWSresult=WSRESULT.$ID."/request.list.png";
  438 + return array('success' => true, 'plotFileURL' => 'http://'.str_replace(BASE_PATH,$_SERVER['SERVER_NAME'].APACHE_ALIAS,$plotWSresult));
  439 + }
  440 + else
  441 + return array('success' => false);
  442 +
429 443 }
430 444  
431 445  
... ... @@ -969,3 +983,4 @@ return array(&#39;success&#39; =&gt; false, &#39;message&#39; =&gt; $message);
969 983  
970 984 }
971 985 ?>
  986 +
... ...
php/old_amda/Parser.php
1 1 <?php
2 2 /** @class Parser
3   -* @version $Id: Parser.php 2918 2015-05-19 13:12:09Z elena $
  3 +* @version $Id: Parser.php 2938 2015-06-05 16:23:33Z elena $
4 4 * @brief
5 5 *
6 6 */
... ... @@ -121,17 +121,18 @@ class Parser {
121 121 public function replaceConstants($chain) {
122 122  
123 123 if ($this->isThereConstant($chain)) {
124   -
  124 +
125 125 $this->dom->load($this->constantsXML);
126 126 $constants_ = $this->dom->getElementsByTagName("constant");
127   -
128   - for ($i = 1; $i < $constants_->length; $i++) {
  127 +
  128 + for ($i = 0; $i < $constants_->length; $i++) {
  129 +
129 130 $constants["@".$constants_->item($i)->getAttribute("name")] = "(".$constants_->item($i)->nodeValue.")";
130 131  
131 132 }
132 133  
133 134 $chainReplaced = strtr($chain, $constants);
134   -
  135 +
135 136 return $chainReplaced;
136 137 }
137 138 return $chain;
... ...
public/wsdl/Methods_AMDA.wsdl
... ... @@ -36,6 +36,9 @@
36 36 <xs:element name="getPlot" type="tns:getPlot"/>
37 37 <xs:element name="getPlotResponse" type="tns:getPlotResponse"/>
38 38  
  39 + <xs:element name="getResultPlot" type="tns:getResultPlot"/>
  40 + <xs:element name="getResultPlotResponse" type="tns:getResultPlotResponse"/>
  41 +
39 42 <xs:element name="getOrbites" type="tns:getOrbites"/>
40 43 <xs:element name="getOrbitesResponse" type="tns:getOrbitesResponse"/>
41 44  
... ... @@ -860,10 +863,35 @@ of a set of typically orthogonal axes.
860 863 <xs:sequence>
861 864 <xs:element name="success" minOccurs="0" maxOccurs="1" type="xs:boolean">
862 865 <xs:annotation>
863   - <xs:documentation>Url of png plot</xs:documentation>
  866 + <xs:documentation>success or not</xs:documentation>
864 867 </xs:annotation>
865 868 </xs:element>
866   - <xs:element name="plotFileURL" type="xs:anyURI" minOccurs="1" maxOccurs="1">
  869 + <xs:element name="plotDirectoryURL" type="xs:string" minOccurs="1" maxOccurs="1">
  870 + <xs:annotation>
  871 + <xs:documentation>URL of directory of png file</xs:documentation>
  872 + </xs:annotation>
  873 + </xs:element>
  874 + </xs:sequence>
  875 + </xs:complexType>
  876 +
  877 + <xs:complexType name="getResultPlot">
  878 + <xs:sequence>
  879 + <xs:element name="plotDirectoryURL" type="xs:string" minOccurs="1" maxOccurs="1">
  880 + <xs:annotation>
  881 + <xs:documentation>URL of directory of png file</xs:documentation>
  882 + </xs:annotation>
  883 + </xs:element>
  884 + </xs:sequence>
  885 + </xs:complexType>
  886 +
  887 + <xs:complexType name="getResultPlotResponse">
  888 + <xs:sequence>
  889 + <xs:element name="success" minOccurs="1" maxOccurs="1" type="xs:boolean">
  890 + <xs:annotation>
  891 + <xs:documentation>success=true if plot exists and else false </xs:documentation>
  892 + </xs:annotation>
  893 + </xs:element>
  894 + <xs:element name="plotFileURL" type="xs:anyURI" minOccurs="0" maxOccurs="1">
867 895 <xs:annotation>
868 896 <xs:documentation>URL of png file</xs:documentation>
869 897 </xs:annotation>
... ... @@ -1090,6 +1118,14 @@ of a set of typically orthogonal axes.
1090 1118 <wsdl:part name="parameters" element="tns:getPlotResponse"> </wsdl:part>
1091 1119 </wsdl:message>
1092 1120  
  1121 + <wsdl:message name="getResultPlot">
  1122 + <wsdl:part name="parameters" element="tns:getResultPlot"> </wsdl:part>
  1123 + </wsdl:message>
  1124 +
  1125 + <wsdl:message name="getResultPlotResponse">
  1126 + <wsdl:part name="parameters" element="tns:getResultPlotResponse"> </wsdl:part>
  1127 + </wsdl:message>
  1128 +
1093 1129  
1094 1130 <wsdl:message name="getOrbites">
1095 1131 <wsdl:part name="parameters" element="tns:getOrbites"> </wsdl:part>
... ... @@ -1146,6 +1182,11 @@ of a set of typically orthogonal axes.
1146 1182 <wsdl:output message="tns:getPlotResponse"> </wsdl:output>
1147 1183 </wsdl:operation>
1148 1184  
  1185 + <wsdl:operation name="getResultPlot">
  1186 + <wsdl:input message="tns:getResultPlot"> </wsdl:input>
  1187 + <wsdl:output message="tns:getResultPlotResponse"> </wsdl:output>
  1188 + </wsdl:operation>
  1189 +
1149 1190 <wsdl:operation name="getOrbites">
1150 1191 <wsdl:input message="tns:getOrbites"> </wsdl:input>
1151 1192 <wsdl:output message="tns:getOrbitesResponse"> </wsdl:output>
... ... @@ -1233,6 +1274,16 @@ of a set of typically orthogonal axes.
1233 1274 </wsdl:output>
1234 1275 </wsdl:operation>
1235 1276  
  1277 + <wsdl:operation name="getResultPlot">
  1278 + <soap:operation soapAction="" style="document"/>
  1279 + <wsdl:input>
  1280 + <soap:body use="literal"/>
  1281 + </wsdl:input>
  1282 + <wsdl:output>
  1283 + <soap:body use="literal"/>
  1284 + </wsdl:output>
  1285 + </wsdl:operation>
  1286 +
1236 1287 <wsdl:operation name="getOrbites">
1237 1288 <soap:operation soapAction="" style="document"/>
1238 1289 <wsdl:input>
... ... @@ -1258,7 +1309,7 @@ of a set of typically orthogonal axes.
1258 1309  
1259 1310 <wsdl:service name="Methods_AMDA">
1260 1311 <wsdl:port name="Methods_AMDAPort" binding="tns:Methods_AMDASoapBinding">
1261   - <soap:address location="http://cdpp1.cesr.fr/AMDA-NG/php/AMDA_METHODS_WSDL.php"/>
  1312 + <soap:address location="http://apus.cesr.fr/AMDA-TEST/php/AMDA_METHODS_WSDL.php"/>
1262 1313 </wsdl:port>
1263 1314 </wsdl:service>
1264 1315 </wsdl:definitions>
... ...