1. How to code GRIN-Global Wizards
October 10, 2017 – GRIN-Global & Genesys Workshop
C I M M Y T - S T A T E O F M E X I C O , T E X C O C O M E X I C O
Carlos Velasquez (CIP) & Edwin Rojas (CIP)
GG Developers
2. Agenda
• CIP Wizards: Screenshots and Diagram of sequences (15 mins)
• Pre-requisites in your Laptop to code Wizards or run Curator Tool source code (30 mins)
• Requirements to Create GRIN-Global Wizards (5 mins)
• How to Create a HelloWorld Wizard (30 mins)
• Overview
• Steps to develop HelloWorld Wizard
• Understanding the parameter SharedUtils
• Understanding the parameter pKeys
• Steps to test HelloWorld Wizard
• Questions to Participants (10 mins)
• How to Create a Welcome Wizard (1 hour)
• Overview
• Steps to develop Welcome Wizard
• Load data from local database
• Get data from GRIN-Global Server
• Save data to GRIN-Global Server
• Steps to test Welcome Wizard
• Running Curator Tool in VS2015 (30 mins)
• Demo of CIP Wizards (30 mins)
3. Pre-requisites in your Laptop to code Wizards or
run Curator Tool source code
• GG Server components installed
• GG Client components installed
• Create an account in GitLab: https://gitlab.com
• Your laptop connected to WiFi: cip-wifi-net
• Installed Visual Studio 2015 Community with Git Support
• Steps how to download source code from GitLab using VS2015 in
the slides 3 to 8:
https://www.slideshare.net/edwinrojas507/workshop-2016-
genebank-it-xamarin-and-crossplatform
4. Requirements to create GRIN-Global Wizards
To Develop
• Visual Studio Community 2015
• .NET Framework 3.5
• GRIN-Global class library (GRINGlobal.Client.Common.dll)
• Download examples from GitLab Repository
To Test
• Curator Tool installed in your PC
• GRIN-Global Server installed in your PC
5. HelloWorld Wizard
The purpose of this project is to be a template for GRIN-Global Wizards
The wizard just displays a hello message
6. How to Create a HelloWorld Wizard
1. Open Visual Studio Community
2. Clone solution from
https://gitlab.com/CIP-Development-
Pub/GRINGlobal-WizardTemplate.git
3. Open the solution Wizards.sln
(figure 3)
Figure 3
7. Steps to develop HelloWorld Wizard
• The solution has a Class Library Project
• The project has Windows Form item
• The project has a reference to GRINGlobal.Client.Common.dll
• Inside Windows Form class implement the Interface
IGRINGlobalDataWizard
• Add the Constructor (string pKeys, SharedUtils sharedUtils) to Windows
Form
• Inside Windows Form add a label control with text “Hello World”
• Build the project to generate DLL file “TemplateWizard.dll”
• Copy the DLL file to the folder Wizards in your Curator Tool installation
• Run Curator Tool and a new Icon will appear in the list of Wizards button
8. Understanding the parameter pKeys
List of ids of selected rows separated by comma
:accessionid=;
:inventoryid=;
:orderrequestid=;
:cooperatorid=;
:geographyid=;
:taxonomygenusid=;
:cropid=;
9. Understanding the parameter SharedUtils
Stores logged user data
• Username
• User Cooperator ID
• Password
• User Language Code
• UserSite
Exposes the following methods
• GetLocalData
• GetWebServiceData
• SaveWebServiceData
• BindComboboxToCodeValue
10. Steps to test HelloWorld Wizard
1. Copy the DLL file to Wizard Folder inside Curator Tool Installation folder
2. Run Curator Tool
3. HelloWorld Wizard Icon and Name will appear in Wizards Toolbar
4. Click on “Hello World Wizard” button
11. Questions to Participants
1. About the GG platform?
a. The frontend tier: Curator Tool + Search Tool + Web Search Tool
b. The Middle tier: GG Core + GG Business
c. The Data tier: Database repository
d. Have a framework for developers
e. Is a suite of tools for Genebanks users
f. The middle tier is in a Webserver
g. The Webserver is an IIS
2. About the local database:
a. Is created in your PC/Laptop
b. Always use the MSSQL instance: sqlexpress
c. Can we change the instance to sqlexpress2017
d. Can we change the name of the local database
e. The local database name is created by Curator Tool
3. About Wizards:
a. To create a Wizard is needed the Curator Tool source code
b. To create a Wizard must be with .NET 3.5
c. The Wizard can connect to the server and local database
d. The CIP template to create Wizards is in GitHub
e. The CIP template to create Wizards is in GitLab
f. You can create workflows
4. About the central database in the server:
a. Is created in your PC/Laptop
b. Always use the MSSQL instance: sqlexpress
c. Can we change the instance to sqlexpress2017
d. Can we change the name of the central database
e. The central database name is created by Curator Tool
1. a,b,c,d,e,f,g
2. a,b,e
3. b,c,e,f
4. c,d
12. Welcome Wizard
The wizard allows to query and update the status code of accession
We will …
• Show logged user information like username and user id
• Query the local database
• Get data of accessions from the GRIN-Global server
• Send changes of accessions to the GRIN-Global server
• Understand the response of saving data webservice
13. How to Create a Welcome Wizard
1. Open Visual Studio Community
2. Clone solution from https://gitlab.com/CIP-Development-Pub/GRINGlobal-
WelcomeWizard.git
3. Open the solution Wizards.sln
15. Steps to develop Welcome Wizard
Load data from local database
DataTable GetLocalData(string SQLSelect, string SQLparms)
Get data from GRIN-Global Server
DataSet GetWebServiceData(string dataviewName, string
delimitedParameterList, int offset, int limit)
Save data to GRIN-Global Server
DataSet SaveWebServiceData(DataSet modifiedDataSet)
16. Steps to test Welcome Wizard
1. Copy the DLL file to Wizard Folder inside Curator Tool Installation folder
2. Run Curator Tool
3. Welcome Wizard Icon and Name will appear in Wizards Toolbar
4. Click on “Welcome Wizard” button
17. Running Curator Tool in VS2015
Requirements
To Run Curator Tool Source Code
• Installed Visual Studio Community 2015
• Installed .NET Framework 4.5.2
• Download the source code from GitLab Repository
• Installed GRIN-Global Server in your PC
18. Running Curator Tool in VS2015
(Curator Tool version 1.9.6.43)
1. Open Visual Studio Community 2015
2. Clone the solution from
https://GGCommunity@gitlab.com/GGCommunity/GRIN-Global-Curator-
tool.git
3. If you don’t have access then request to Juan Carlos Alarcón
4. Open the solution: GRINGlobal.Client.sln
5. If a window with title “Review Project and Solution Changes” appears,
just click the “OK” button (figure 1)
6. Set GRINGlobal.Client.CuratorTool as Startup project (figure 2)
Right-click and select “Set as StartUp Project”
7. Click the “Start” button
21. The International Potato Center (known by its Spanish acronym CIP) is
a research-for-development organization with a focus on potato, sweetpotato,
and Andean roots and tubers. CIP is dedicated to delivering sustainable
science-based solutions to the pressing world issues of hunger, poverty,
gender equity, climate change and the preservation of our Earth’s fragile
biodiversity and natural resources.
www.cipotato.org
CIP is a member of CGIAR
CGIAR is a global agriculture research partnership for a food secure future. Its
science is carried out by the 15 research centers who are members of the
CGIAR Consortium in collaboration with hundreds of partner organizations.
www.cgiar.org