Ticket #7639 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Support for ICAT4

Reported by: Jay Rainey Owned by: Jay Rainey
Priority: major Milestone: Release 3.0
Component: Framework Keywords: ICAT4
Cc: Blocked By: #7688
Blocking: Tester: Owen Arnold

Description

Create a class that achieves the same functionality as ICat3Catalog.cpp using the new ICAT4 interface.

Change History

comment:1 Changed 7 years ago by Jay Rainey

  • Status changed from new to inprogress

comment:2 Changed 7 years ago by Jay Rainey

  • Blocked By 7688 added

comment:3 Changed 7 years ago by Jay Rainey

Added ICat4 gSoap generated files. Refs #7639

  • Increased filesize of gitattribute to allow gSoap generated files to be commited.

Changeset: 65794a6fbbf46b26533e6a8f88599a7f8c33e192

comment:4 Changed 7 years ago by Jay Rainey

Fixed include paths for generated files. Refs #7639

Changeset: 6d462a076ab19eae72310ed277165931261b5cd7

comment:5 Changed 7 years ago by Jay Rainey

Reorganise ICat3 dependent files. Refs #7639

  • Moved helper files to ICat3 folder
  • Updated and reorganised CMakelists.txt
  • Removed unused ICatHelper.h include from CatalogSearch.h

Changeset: 319a35418adad535dd9e4db56894febb3a29c7f5

comment:6 Changed 7 years ago by Jay Rainey

Removed ErrorHandling dependencies from ICat algorithms. Refs #7639.

  • Renamed ErrorHandling to ICat3ErrorHandling as this class should now only interact with the ICat3 specific algorithm.
  • Moved and renamed GSoapGeneration class to ICat3 domain.
  • Updated CMakeLists to reflect name changes.

Changeset: eb76178bf77724e3d8a2487e4b2f0f7bd247199f

comment:7 Changed 7 years ago by Jay Rainey

Added namespace support for GSoap ICat3 generated code. Refs #7639.

  • Updated ICat3 classes to make use of namespace.
  • Renamed GSoapGenerated code to reflect associated namespace.
  • Added soapserializersC to GSoap.cpp to prevent warnings.
  • Updated gitattributes to reflect name changes.

Changeset: 96bc85b3bb997195ed1eb6d26bb381883b16b283

comment:8 Changed 7 years ago by Jay Rainey

Added namespace support for GSoap ICat4 generated code. Refs #7639.

  • Renamed GSoapGenerated classes code to reflect associated namespace used.
  • Added ICat4GsoapGenerated.cpp to prevent warnings.
  • Updated README.md to reflect namespace problems and appropriate solutions.

Changeset: d687c2d71bf717356990d6f4fbc111c3ce728efb

comment:9 Changed 7 years ago by Jay Rainey

Login and logout functionality implemented. Refs #7639.

  • Encapsulated SSL authentication scheme into own function to prevent duplication of code.
  • Error message method ensures user friendly and accurate gSoap errors are output.

Changeset: 3a998164239cf7c4e37467db05d6595799e9e52d

comment:10 Changed 7 years ago by Jay Rainey

List instruments functionality implemented. Refs #7639.

  • Changed plugin type as uows is needed to route query via the ISIS user office systems.

Changeset: c3aef365609fc7363225c1b598744ac3ddc49bf9

comment:11 Changed 7 years ago by Jay Rainey

List investigation type functionality implemented. Refs #7639.

Changeset: d63f1ff33a8bf52da52f46501a403fca47a30a87

comment:12 Changed 7 years ago by Jay Rainey

Small naming consistency fix. Refs #7639.

Changeset: eae564e0b0a2127e9c4c518e2525b34fdb851337

comment:13 Changed 7 years ago by Jay Rainey

My data functionality implemented. Refs #7639.

Changeset: 1414a84e62286e5c531c447cd404dd13229e252e

comment:14 Changed 7 years ago by Jay Rainey

Minor name changes and error improvements. Refs #7639.

Changeset: c078705b22cceb4a9af778cac873e8eaea05fcb6

comment:15 Changed 7 years ago by Jay Rainey

Search query encapsulated and reorganised includes. Refs #7639.

Changeset: f0c4a118ab416caecb09e262e888345a92fb0ba2

comment:16 Changed 7 years ago by Jay Rainey

Implemented getDataFiles and saveDataFiles methods. Refs #7639.

  • Created method to convert timestamp to human readable datetime.
  • Removed unnecessary addMyDataColumnHeader method.
  • Added investigation type to query method.

Changeset: ca418ade874c6b77470ba347bca48fc19da6dc65

comment:17 Changed 7 years ago by Jay Rainey

Improved getSearchQuery. Refs #7639.

  • Added check to run parameters in saveInvestigations to prevent null pointer.
  • Renamed output workspace parameter in several methods to be consistent.

Changeset: d9af9389a642440fa39f222f83e8e3ccaa1991cb

comment:18 Changed 7 years ago by Jay Rainey

Checkpointing: Tided up code. Refs #7639.

  • Check dynamic casts for null pointers
  • Removed unnecessary comments.
  • Improved parameter names in ICat4Catalog header file.

Changeset: cfcb7f67bd0eaa37af18eeb5939516b4d2408b82

comment:19 Changed 7 years ago by Jay Rainey

Added getDatasets and saveDataSets functionality. Refs #7639.

  • Note: currently the saveDataSets method saves empty strings to the workspace. This was to prevent Mantid from dying as the GUI expects there to be values. This will be fixed in another ticket.

Changeset: 5e7393a05769a2944e80fb1373e5e1302e47bf12

comment:20 Changed 7 years ago by Jay Rainey

Added getFileLocation functionality. Refs #7639.

  • Note: This currently works on windows as file paths are not modified for other operating systems, and the mount point of the archive is not taken into account.

Changeset: dec357e110978e1201f6fb3473ee50865bb5054b

comment:21 Changed 7 years ago by Jay Rainey

Added logger functionality to ICat4Catalog. Refs #7639.

Changeset: 4fafe3165c4f46b8b748e13a79363e548523f7dc

comment:22 Changed 7 years ago by Jay Rainey

Added main search functionality. Refs #7639.

  • In order to search for datetimes the format needs to match the server's. This is in the form of: Y/M/D h/m/s.

Changeset: f3ebffff8b9dd236df764ed7bc91359691cfa9c8

comment:23 Changed 7 years ago by Jay Rainey

Merge remote-tracking branch 'origin/master' into feature/7639_Add_support_for_ICAT4_interface

Conflicts:

Code/Mantid/Framework/ICat/src/ICat3/ICat3Helper.cpp

Refs #7639.

Changeset: 62b7d341ef6a8c019838ecd12a4412360ebc7332

comment:24 Changed 7 years ago by Jay Rainey

Updated gitattributes for larger XML files. Refs #7639.

Changeset: cdeb22bb51dc8fbc7549a4412d3d77534170d277

comment:25 Changed 7 years ago by Jay Rainey

  • Status changed from inprogress to verify
  • Resolution set to fixed

Note: In order to test this ticket you must be using a windows operating system that has access to the archive data. This is because you cannot download the data files in ICAT4 if you are an external user. This will be fixed in another ticket.

ICAT folder structure

  • Review changes from comment:3 to comment:8 and ensure the folder structure is logical, and that the related classes are in a the correct folders.

ICAT3 functionality

As all the ICAT3 files were moved I believe it would be worthwhile testing ICAT3 to ensure it functions correctly. To do this:

  1. Open Mantid
  2. Click Catalog -> Login (Located in the top menu bar).
  3. Click My Data search. You should be able to view your specific data.
  4. Click Basic search and ensure all fields work correctly.
    1. Click on a result and the Investigation data GUI will open.
    2. Click the dropdown arrow on Run range, then click Runs. This will load the related datafile information found for the specific file.
    3. Click download and the file will download.
  5. Click Advanced search and ensure the same.
  6. Click Logout and try to access something that you cannot (such as searching). You should not be able to.
  7. Break it!

ICAT4 functionality

To test ICAT4 functionality you must change the catalog name and soapEndPoint in the Facilities.xml file to have the following: (They're located at the top of the file)

  <catalog name="ICat4Catalog">
  </catalog>

  <soapEndPoint url="https://icatisis.esc.rl.ac.uk/ICATService/ICAT">
  </soapEndPoint>

Once this is done, follow the same process as noted in ICAT3 functionality above for testing. The same functionality should occur.

comment:26 Changed 7 years ago by Russell Taylor

  • Status changed from verify to reopened
  • Resolution fixed deleted

There are a couple of compiler warnings in ICat4Catalog.cpp that need addressing: https://builds.sns.gov/job/ornl_clean_rhel6_develop/warnings16

comment:27 Changed 7 years ago by Jay Rainey

  • Status changed from reopened to inprogress

Suppressed a couple of compiler warnings. Refs #7639.

Changeset: 6efe855303bac13142b6688dd764982fd3d86f20

comment:28 Changed 7 years ago by Jay Rainey

Improved login error output. Refs #7639.

Changeset: 43e034925dda7c82e0a7179fbee196bb829e8437

comment:29 Changed 7 years ago by Owen Arnold

  • Compiler warnings need addressing. Some of these are around catching an exception by reference with a named paramter, which is never used.
  • Related to the above - do not catch an exception as generic as a runtime_error and then throw a new runtime_error. The original runtime_error may not originate from the location you are anticipating.
  • Download functionality seems to be broken (if it was ever working in the old code). I do seem to be able to load run files found in my investigations though.

comment:30 Changed 7 years ago by Jay Rainey

Improved login error output for ICAT3 and ICAT4. Refs #7639.

Changeset: d2e3e6a77f57806a3c82060645ced03426c3a437

comment:31 Changed 7 years ago by Jay Rainey

Improved exception handling in ICat4Catalog.cpp. Refs #7639.

Changeset: da95f02b3229ab8d7f43b1a3710d56fb0573d906

comment:32 Changed 7 years ago by Jay Rainey

Improved logout error message for ICAT. Refs #7639.

Changeset: 9545bb956cffd7d150726510977261ddec47ff26

comment:33 Changed 7 years ago by Jay Rainey

Inform user where download file is being saved to. Refs #7639.

Changeset: fe17ad900abdd11feadb453005b0643f968f2ab7

comment:34 Changed 7 years ago by Jay Rainey

Replying to Owen Arnold:

Compiler warnings need addressing. Some of these are around catching an exception by reference with a named paramter, which is never used.

I will implement the functionality for downloading externally (e.g. user doesn't have access the /archives/) in another ticket. So have suppressed the compiler warnings for now. See comment:27 and jenkins.

Related to the above - do not catch an exception as generic as a runtime_error and then throw a new runtime_error. The original runtime_error may not originate from the location you are anticipating.

This has been resolved in comment:31.

Download functionality seems to be broken (if it was ever working in the old code). I do seem to be able to load run files found in my investigations though.

Download functionality works, but the user does not get told where the files are downloaded to. This will be resolved in comment:33. (Note: in the new ICAT gui the user will be able to tell Mantid where they want to download the file to.)

To test the download functionality, change your default save directory (File -> Manage User Directories), and when you download a notice will be made to inform you of the location the file is being saved to. (By default it's saved where your executable is).

comment:35 Changed 7 years ago by Jay Rainey

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:36 Changed 7 years ago by Owen Arnold

  • Status changed from verify to verifying
  • Tester set to Owen Arnold

No compiler warnings now. System tests seem to be fixed.

There are no tests here. Testing networking functionality as part of a unit test (and most other kinds of automated test) is wrong, however, I would consider mocking out some of the abstract classes and unit testing their utilisation using a combination of dependency injection, mocking and unit testing.

Last edited 7 years ago by Owen Arnold (previous) (diff)

comment:37 Changed 7 years ago by Owen Arnold

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/7639_Add_support_for_ICAT4_interface'

comment:38 Changed 7 years ago by Owen Arnold

Merge remote-tracking branch 'origin/feature/7639_Add_support_for_ICAT4_interface'

comment:39 Changed 7 years ago by Jay Rainey

Improved login error output. Refs #7639.

Changeset: 43e034925dda7c82e0a7179fbee196bb829e8437

comment:40 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8484

Note: See TracTickets for help on using tickets.