Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic...
Transcript of Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic...
![Page 1: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/1.jpg)
Plug-in Development Environment
![Page 2: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/2.jpg)
Session Outline
• Tools
• Installation
• Configuration
• New Project
• Basic Debugging
• Remote Debugging
![Page 3: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/3.jpg)
Tools
• Install a JDK (if needed)– J2SE downloads
• Install Integrated Development Environment (IDE)– Using Eclipse as an example
• Free• Fully featured• Eclipse download
– Other IDEs available• JBuilder• NetBeans• IntelliJ
![Page 4: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/4.jpg)
Installation
• Use an application that handles zip files, such as WinZip or Windows Explorer, to extract the Eclipse files into a folder.
![Page 5: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/5.jpg)
Installation
• Install Tomcat plug-in for Eclipse– Tomcat plug-in.– Allows Tomcat to run in the context of the IDE.– Configure the plug-in to use CenterView’s
Tomcat installation.
![Page 6: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/6.jpg)
Installation
• Unzip the Tomcat plug-in into the Eclipse dropins folder.
![Page 7: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/7.jpg)
Configuration
• Start Eclipse (eclipse/eclipse.exe).
• Choose a workspace.
![Page 8: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/8.jpg)
Configuration
• Go to the workbench.
![Page 9: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/9.jpg)
Configuration
• Select Preferences from the Window menu.
![Page 10: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/10.jpg)
Configuration
• Select the Tomcat preferences, set Version 5.x, and browse to the Tomcat of your CenterView installation. Then click OK.
![Page 11: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/11.jpg)
New Project
• Create a new project in Eclipse– Plug-in source code is part of this project.– Builds the CenterView plug-in (class files).– Set as a Tomcat project (if needed).
![Page 12: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/12.jpg)
New Project
• Select Java Project from the drop-down.
![Page 13: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/13.jpg)
New Project
• Type the project name and click Finish.
![Page 14: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/14.jpg)
New Project
• Create a CenterView plug-in file– Configure the external JARs.– Create the package.– Create the new class.
![Page 15: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/15.jpg)
New Project
• Select Properties > Java Path from the Project menu, then add the API JARs using Add External JARs and navigating to CenterView folder/Server/plugins/lib/api.
![Page 16: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/16.jpg)
New Project
• Create a new package by expanding the project, right-clicking src, then clicking New > Package.
![Page 17: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/17.jpg)
New Project
• Type the package name and click Finish.
![Page 18: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/18.jpg)
New Project
• Two options with class file location– Local to Project
• Already configured for it.• Must copy to another directory to use.
– Local to CenterView• Advanced configuration.• No need to copy class files.
![Page 19: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/19.jpg)
Basic Debugging
• Start the database.• Start the Eclipse IDE.• Start Tomcat from the IDE.• Put a breakpoint in the plug-in code.• Display the dashboard item that is
associated with the plug-in (preview in browser or select in Builder).
• Control returns to the IDE to allow debugging.
![Page 20: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/20.jpg)
Basic Debugging
• Since you are not using the batch file to start CenterView Server, you need to start the database separately.
• To start Postgres separately:– Navigate to CenterView folder/Pgsql.– Run postgresql start.
• If you are using another database, it needs to be running.
![Page 21: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/21.jpg)
Basic Debugging
• Alternately, you can set up an External Tool Configuration.
![Page 22: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/22.jpg)
Basic Debugging
• Browse the file system to locate the postgresql script file, add start to the Arguments list, give it a name, then click Apply.
![Page 23: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/23.jpg)
Basic Debugging
• Start Tomcat by selecting the Tomcat Start button on the tool bar.
![Page 24: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/24.jpg)
Basic Debugging
• Select a Java file in your package, then double-click in the gray bar to add a breakpoint at a specific line in the code.
![Page 25: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/25.jpg)
Basic Debugging
• The IDE switches to a Debug perspective when a breakpoint is hit.
![Page 26: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/26.jpg)
Remote Debugging
• IDEs also have the ability to remotely debug a process– Requires the JVM of the process to be
debugged to start with certain flags set (Tomcat Startup script).
– IDE needs to connect to this process to debug.
![Page 27: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/27.jpg)
Remote Debugging
Tomcat Startup (Windows version)
SET INSTALLDIR=C:\PDE\CenterView3
SET JAVA_HOME=%INSTALLDIR%\jre
SET CATALINA_HOME=%INSTALLDIR%\Tomcat
SET CATALINA_BASE=%INSTALLDIR%\Tomcat
SET JAVA_OPTS=-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties -Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA_HOME% -Djava.io.tmpdir=%CATALINA_BASE%\temp
SET JAVA_DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,suspend=n,server=y
%JAVA_HOME%\bin\java -cp %CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_HOME%\bin\commons-logging-api.jar %JAVA_OPTS% %JAVA_DEBUG% org.apache.catalina.startup.Bootstrap
![Page 28: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/28.jpg)
Remote Debugging
• Optionally, you can modify the CenterView3/Tomcat/TomcatLauncher.properties file and add the following line:
Application.commandline.options=-Xdebug;-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787
![Page 29: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/29.jpg)
Remote Debugging
• Select Debug Configurations from the Debug tool bar drop-down.
![Page 30: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/30.jpg)
Remote Debugging
• Select Remote Java Application from the list.
• Click the New button in the Content pane.
• Change the configuration name and the port, then browse for the current project.
• Click Apply to save the changes.
![Page 31: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/31.jpg)
Remote Debugging
![Page 32: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/32.jpg)
Remote Debugging
• When debugging remotely:– Start the database.– Start Tomcat using the script.– Start the IDE.– Select Debug Configuration from the Debug
tool bar drop-down.– Set breakpoints in code.– Display the dashboard in the browser.
![Page 33: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/33.jpg)
Additional Resources
• Corda Connection – Visual Evolution 2008 – Go to portal.corda.com– Login– Resources– Visual Evolution 2008
• Other VE topics
![Page 34: Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.](https://reader036.fdocuments.us/reader036/viewer/2022062308/56649eb15503460f94bb69e4/html5/thumbnails/34.jpg)