Difference between revisions of "How to setup Eclipse/RAP"

From NetXMS Wiki
Jump to navigation Jump to search
 
m (Text replacement - "^" to "{{deprecated}}")
 
(43 intermediate revisions by 8 users not shown)
Line 1: Line 1:
== Eclipse and Target Platform setup ==
{{deprecated}}= Eclipse and Target Platform setup =


* Download Eclipse 4.2M5 from http://download.eclipse.org/eclipse/downloads/drops4/S-4.2M5-201201271145/
* Download Eclipse 4.15 (2020-03) for RCP and RAP Developers from https://www.eclipse.org/downloads/eclipse-packages/
* Unpack and run
* Unpack and run
* Help -> Install New Software -> add new source "RAP Tooling" - http://download.eclipse.org/rt/rap/1.5/tooling
* Go to Window -> Preferences -> Plugin-in Development -> Target Platform, click "Add", initialize target definition with "Nothing"
* Install "Rich Ajax Platrorm (RAP)" from that source
* Change name to something like 'RAP 3.12"
* Create directory somewhere on file system (I'll use /Users/alk/Documents/RAP)
* (still in target content editor) Add software site http://download.eclipse.org/releases/2019-06, '''uncheck''' "Include Required Software" and install "EMF - Eclipse Modeling Framework SDK" (from Modeling) and "BIRT Framework" (from Business Intelligence, Reporting and Charting)
* Copy com.ibm.icu_4.4.2.v20110823.jar from Eclipse runtime to /Users/alk/Documents/RAP
* Add software site http://download.eclipse.org/rt/rap/3.12, '''uncheck''' "Include Required Software" and install everything
* Go to Preferences -> Plugin-in Development -> Target Platform, click "Add", initialize target definition with "Nothing"
* Add software site http://www.netxms.org/eclipse/zest-rap/, '''uncheck''' "Include Required Software" and install everything
* Change name to something like 'RAP 1.5"
* Add software site http://download.eclipse.org/tools/orbit/downloads/drops/R20170919201930/repository, '''uncheck''' "Include Required Software" and install "ICU4J" and "Apache Commons Codec 1.9.0"
* (still in target content editor) Add software site http://download.eclipse.org/releases/juno, '''uncheck''' "Include Required Software" and install "EMF - Eclipse Modeling Framework SDK"
* Add software site http://download.eclipse.org/technology/babel/update-site/R0.17.1/2019-12/, '''uncheck''' "Include Required Software" and install "Babel Language Pack for eclipse" and "Babel Language Pack for modeling.emf" (Arabic, Czech, French, German, Portuguese, Portuguese (Brazilian), Russian, Spanish)
* Add software site http://download.eclipse.org/birt/update-site/2.6, '''uncheck''' "Include Required Software" and install "BIRT Chart Framework" (from BIRT 2.6 Charting SDK)
* Add software site http://download.eclipse.org/rt/rap/1.5/runtime, '''uncheck''' "Include Required Software" and install everything
* Add software site http://download.eclipse.org/rt/rap/1.5/incubator, '''uncheck''' "Include Required Software" and install "RAP File Upload support"
* Add directory /Users/alk/Documents/RAP


Is should be like this:
Is should be like this:


[[File:rap_1_5_target_platform.png]]
[[File:RAP 3.12 Target Platform.png|724px]]


* In trunk/src/java, run package.sh (or package.cmd on Windows)
* Import existing project from src/java-common into workspace


* Import existing projects from trunk/webui/webapp into workspace, it should build fine.
* Import existing project from src/client/java into workspace


== Run Configuration ==
* Import existing projects from webui/webapp into workspace
 
= Run Configuration =


* Create new Run Configuration (of type "RAP Application")
* Create new Run Configuration (of type "RAP Application")
* Click "browse" and select Servlet Name (nxmc)
* Enter "/nxmc" as servlet path
* Click "browse" and select Entry Point (org.netxms.webui.core.nxmc)
* Switch to "Bundles" tab, click on "Deselect All"
* Switch to "Bundles" tab, click on "Deselect All"
* Add working set -> add your workspace with all WebUI projects
* Add working set -> add your workspace with all WebUI projects
* Filter for "http.jetty" and select "org.eclipse.equinox.http.jetty"
* Filter for "http.jetty" and select "org.eclipse.equinox.http.jetty"
* Filter for "design" and select "org.eclipse.rap.design.example"
* Filter for "console" and select "org.eclipse.equinox.console"
* Filter for "console" and select "org.eclipse.equinox.console"
* Filter for "felix*shell" and select orf.apache.felix.gogo.shell
* Filter for "felix*shell" and select org.apache.felix.gogo.shell
* Clear filter field and click "Add Required Bundles"
* Clear filter field and click "Add Required Bundles"
* Uncheck "com.ibm.icu.base" - only "com.ibm.icu" must be selected
* Click on Validate
* Click on Validate
* Apply and Run
* Apply and Run


If browser complains about too many redirects (seen that on Mac) - just refresh page.
If browser complains about too many redirects (seen that on Mac) - just refresh page.
= WAR export =
Use Apache Maven:
# updates versions in pom files
mvn -f webui/webapp/pom.xml -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:update-pom -Pweb
# build console
mvn -f webui/webapp/pom.xml clean package -Pweb -Dtycho.disableP2Mirrors=true
Build will be in webui/webapp/Product/target
= Possible fixes if Eclipse acting weird =
* Refresh sources
* Clean and rebuild all
* Repeat refresh / clean once more
* Refresh platform (Preferences -> Target Platform -> (select it) -> Reload
* Go to "Edit platform", select each Update site's URL and click on "Update"

Latest revision as of 18:13, 13 September 2022

This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide)

= Eclipse and Target Platform setup =

Is should be like this:

Error creating thumbnail: Unable to save thumbnail to destination
  • Import existing project from src/java-common into workspace
  • Import existing project from src/client/java into workspace
  • Import existing projects from webui/webapp into workspace

Run Configuration

  • Create new Run Configuration (of type "RAP Application")
  • Enter "/nxmc" as servlet path
  • Switch to "Bundles" tab, click on "Deselect All"
  • Add working set -> add your workspace with all WebUI projects
  • Filter for "http.jetty" and select "org.eclipse.equinox.http.jetty"
  • Filter for "console" and select "org.eclipse.equinox.console"
  • Filter for "felix*shell" and select org.apache.felix.gogo.shell
  • Clear filter field and click "Add Required Bundles"
  • Uncheck "com.ibm.icu.base" - only "com.ibm.icu" must be selected
  • Click on Validate
  • Apply and Run

If browser complains about too many redirects (seen that on Mac) - just refresh page.

WAR export

Use Apache Maven:

# updates versions in pom files
mvn -f webui/webapp/pom.xml -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:update-pom -Pweb
# build console
mvn -f webui/webapp/pom.xml clean package -Pweb -Dtycho.disableP2Mirrors=true

Build will be in webui/webapp/Product/target


Possible fixes if Eclipse acting weird

  • Refresh sources
  • Clean and rebuild all
  • Repeat refresh / clean once more
  • Refresh platform (Preferences -> Target Platform -> (select it) -> Reload
  • Go to "Edit platform", select each Update site's URL and click on "Update"