Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 56

SAFE X3 Studio

Improving X3 Developer
Experience with Eclipse 

Improving X3 Developer Experience with Eclipse 1


Improving X3 Developer
Experience with Eclipse
Introduction

Improving X3 Developer Experience with Eclipse 2


Introduction
Eclipse

What is Eclipse?
Eclipse is an open source community, whose projects are focused on building an open
development platform comprised of extensible frameworks, tools and runtimes for building,
deploying and managing software across the lifecycle.

Why Eclipse?
More than an IDE
– Commonly used for programming in Java, C/C++, PHP, Javascript, Python,...
– To develop Desktop, Webtop or server applications.
Advantages of the Eclipse Platform
– Plug-ins dynamically loaded when needed
– Integrated updates system
– Customization
– Multi OS (Windows, Linux, Mac, ...)

Improving X3 Developer Experience with Eclipse 3


Introduction
Eclipse

COPY

Client
(Eclipse)

SAVE
Local X3 Server
Workspace

LOAD

Improving X3 Developer Experience with Eclipse 4


Pre-Requisites
Platform
X3 Application
X3 Runtime
Client side

Improving X3 Developer Experience with Eclipse 5


Pre-Requisites
Platform

Eclipse
Eclipse IDE for Java Developers http://www.eclipse.org/downloads/
– Indigo SR2 3.7.2 plug-in 1.2.5
– Juno SR1 for plug-in 1.2.6
– Galileo version is no longer supported

Java Some versions of Sage ERP X3


running with Oracle Database may
Run Time Environment http://www.java.com use an earlier version of the Java
– Java 7 with latest update Runtime (v 1.4).
– Java 6 with latest update
Ensure that when Eclipse is started it is running
– Use 64-bit Java with 64-bit Eclipse the correct version.

Internet Access
From installation environment

Improving X3 Developer Experience with Eclipse 6


Pre-Requisites
X3 Application

Processes for plug-in 1.2.5


AXDTMAIN, WMAXDCOR_125, WMAXDBG process in the reference folder (X3) or current
folder.

Processes for plug-in 1.2.6


AXDTMAIN, AXDTCOR_126, AXDTDBG process in the reference folder (X3) or current
folder.

JAR for X3 desktop client interaction with Eclipse


Ideclient.jar in the directory .../X3_PUB/X3_ROOT/X3CLI

Patch level
Latest is recommended, but at least Patch 17 for V6
– Debugging X3 process from Eclipse

Improving X3 Developer Experience with Eclipse 7


Pre-Requisites
X3 Runtime

V5
– Runtime ≥ 15r.120 Allows editing of process

V6
Latest runtime is recommended, but at least:
– Runtime ≥ 16r.114 Running Eclipse from X3 Client
– Runtime ≥ 16r.115 Running X3 process from Eclipse
– Runtime ≥ 16r.217 Debugging X3 process from Eclipse

Improving X3 Developer Experience with Eclipse 8


Pre-Requisites
Client side

Client
CLI.109 or sup. recommended
– Running Eclipse from X3 Client (CLI.104)
– Running X3 process from Eclipse (CLI.105)
– Debugging X3 process from Eclipse (CLI.109)

SAFE X3 Studio Plugin


Version 1.2.5.v20120309-1654
– Debugging X3 process from Eclipse
Version 1.2.6 (available soon)
– Improve debugging and responsiveness
Older version?
– Please, update ASAP!

Improving X3 Developer Experience with Eclipse 9


Installing & Configuring
Java
Eclipse
Safe X3 Studio Plug-in
Safe X3 Studio Debugger
Client side
Parameters

Improving X3 Developer Experience with Eclipse 10


Installing & Configuring
Java

Checking installation
Run the downloaded installer program and follow the instructions
Start command line and check default version

For security reason, it is recommended


to always use the latest Java Runtime.

Improving X3 Developer Experience with Eclipse 11


Installing & Configuring
Eclipse

Which Eclipse version to use?

SAFE X3 Studio 1.2.5


– Indigo SR2 is recommended
– Juno SR1 can be used but there is an install issue with the Mylyn Plugin.
A Workaround is available on OSP
https://oursageplace.com/fr/web/our-sage-place/safe-x3-studio-for-eclipse/-/
blogs/installing-safe-x3-studio-1-2-5-in-eclipse-juno

SAFE X3 Studio 1.2.6


– Juno SR1 is recommended (Install issue is fixed)
– Kepler pre-release is under testing without compatibility issue reported at this stage.

Downloadable packages - The easiest and recommended way to start!


– http://pluginx3.sage.fr/safex3/studio/downloads/downloads.html
Improving X3 Developer Experience with Eclipse 12
Installing & Configuring
Eclipse

No Setup
Eclipse does not have an install program.
The download is extracted in an appropriate directory
– e.g.  C:\eclipse\, C:\eclipse\3.7\, C:\eclipse\juno\, …

If Java version is old version, Eclipse configuration file needs to be changed


– e.g. C:\eclipse\eclipse.ini

– Ensure the –vm tag is placed BEFORE the –vmargs tag

Improving X3 Developer Experience with Eclipse 13


Installing & Configuring
Eclipse

Boot parameters

To select a workspace
– eclipse.exe –data workspace_path

To start eclipse with a specific language


– eclipse.exe -nl en  English
– eclipse.exe -nl en_UK  British
– eclipse.exe -nl en_US  American
– eclipse.exe -nl fr  French

More information
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/running
_eclipse.htm

Improving X3 Developer Experience with Eclipse 14


Installing & Configuring
Safe X3 Studio Plug-in

Workspace directory
Start Eclipse
Choose a Workspace directory
– Do not use a sub-directory within the Eclipse install directory, as this could be
overwritten if a new version of Eclipse is installed

Improving X3 Developer Experience with Eclipse 15


Installing & Configuring
Safe X3 Studio Plug-in

Network Connections
Once Eclipse has started we may need to
configure the HTTP access if there is a proxy
server
– Window > Preferences
– General > Network Connections

– Direct = No proxy
– Native = System Settings
– Recommended but does not always work
– Manual = Entered by User

For manual entries, User and Password are shared between Eclipse installations
Window > Preferences > General > Security > Secure Storage

%USERPROFILE%\.eclipse\org.eclipse.equinox.security\secure_storage

Improving X3 Developer Experience with Eclipse 16


Installing & Configuring
Safe X3 Studio Plug-in

Repository
– Help > Install New Software…
– Add Repository
Name: Leave blank. Will be filled with metadata repository
Location: http://pluginx3.sage.fr/safex3/studio/1.2/updates/

Improving X3 Developer Experience with Eclipse 17


Installing & Configuring
Safe X3 Studio Plug-in

Safe X3 Studio

Menu Help > Install New Software


– Work with « SAFE X3 Studio repositories »
– Tick « SAFE X3 Studio for Eclipse »
To speedup install process, untick
– Click on « Next > », « Next > » “Contact all update sites during install to
– Accept license terms find required software”.
– Click on « Finish »
– Restart Eclipse when asked
If you encounter issues tick it again!

Menu Help > Check for updates


– Check all referenced sites in order to find available updates.
– Install updates then restart Eclipse

Improving X3 Developer Experience with Eclipse 18


Installing & Configuring
Safe X3 Studio Plug-in

How to update my version?

Without updating Eclipse release


– Use the SAFE X3 Studio update site as for a first install

Updating Eclipse release simultaneously


– Start with a clean copy of Eclipse rather than update the current version.
– Alternatively, use the Eclipse update site of the new release
http://wiki.eclipse.org/FAQ_How_do_I_upgrade_Eclipse%3F
– Then use the SAFE X3 Studio update site

Improving X3 Developer Experience with Eclipse 19


Installing & Configuring
Safe X3 Studio Plug-in

Version Control System


Eclipse Juno is now delivered with Egit.
– You will have some messages asking you to configure Egit.
– Safely ignore them if you do not plan to use it.

SAFE X3 Studio is now delivered with Subversive Team provider.


– A message will invite you to install Connectors.
– Selecting all the SVN Kit connectors will usually fit your potential need.
– Finish the installation by clicking Next >, Next >, ….

Improving X3 Developer Experience with Eclipse 20


Installing & Configuring
Safe X3 Studio Debugger

Perspective
The debugger works using the perspective « Debug »
Window > Preferences > Perspective

« Always » or « Prompt »

« Debug » for both


SAFE X3 File
and
SAFE X3 Project

Improving X3 Developer Experience with Eclipse 21


Installing & Configuring
Client side

SAFE X3 Studio parameters


Tools > Options... > SAFE X3 Studio

Eclipse installation directory


– By default this is the same as the client

Eclipse Workspace directory to use for this session


– Put the same path as it is displayed in the “Select
a workspace” Eclipse dialog box

Server pooling
– Tick the check box to enable running and
Configuration is per folder, thus don't
debugging process from Eclipse forget to edit this parameters for each
one.
It is recommended to use the same
workspace for all folders.

Improving X3 Developer Experience with Eclipse 22


Installing & Configuring
Parameters

Parameters

AECLIPSE : Activate tunnelling towards Eclipse

AECLIDBG : Activate the Eclipse debugger

AECLIMAC : Defines the machine on which the Eclipse debugger will run
– By default this is the same as the client

AECLIPRT :Connection Port between Eclipse Debugger and SAFE X3


– By default is 0. If zero then 10000 is used

AECLIMAC and AECLIPRT are overridden by the “Rendez-vous”


mechanism, thus they are only relevant while using “dbgaff”
instruction or “Dbg on/off” functionality.

Improving X3 Developer Experience with Eclipse 23


Installing & Configuring
Parameters

In Client using Usage > Users > Personalization

In Eclipse using Project > User parameters


AECLIPSE

AECLIDBG
AECLIMAC
AECLIDBGTR

AECLIPRT
Improving X3 Developer Experience with Eclipse 24
Using SAFE X3 Studio
Editor
Debugger

Improving X3 Developer Experience with Eclipse 25


Using SAFE X3 Studio
Editor

Improving X3 Developer Experience with Eclipse 26


Using SAFE X3 Studio
Editor – Online Help

Integrated Help available


DON’T MISS!
Help > Help Contents > SAFE X3 Studio User Guide

Improving X3 Developer Experience with Eclipse 27


Using SAFE X3 Studio
Editor

Perspectives
Define a way of organizing your environment
– SAFE X3 Studio perspective

Window > Open Perspective

Views
Windows designed to complete the editor
Different services and information
– Source files explorer
– Outline (synthetic view of the source code)
– List of errors
– List of locked files
– ...

Window > Show View

Improving X3 Developer Experience with Eclipse 28


Using SAFE X3 Studio
Editor

Creating new project


File > New > Project ...

Choose « SAFE X3 Project »


« Next > »
Name your project (ex: myserver_DEMO)
Enter information for connection to X3 (idem client X3)
– Folder (ex: DEMO)
– Hostname (ex: myserver) After editing the server name
– Port (ex: 16000) and port, the available folders
are fulfilled, and then available
– X3 User et X3 Password languages.
– Language (ex: FRA, ENG, ...)
– User et Password (OS authentication)
– Help  Only enter if there is no doc in solution.xml .
« Finish »

Improving X3 Developer Experience with Eclipse 29


Using SAFE X3 Studio
Editor

Adding processes
Select your project, then
File > Open SAFE X3 Source file...

– Select your file in the list


– Filter the list
– Directly enter the name of your process

Organizing by creating folders


Right-click on your project then
Organizing by tags is also
available using the dedicated
New > Folder
X3 Explorer view.
Shortcut is Ctrl+Shift++ while
selecting a file.
– Select your files
– Drag & drop your files
OR
– Right-click then Move…
Improving X3 Developer Experience with Eclipse 30
Using SAFE X3 Studio
Editor - Functionality

Views

Project Explorer : Projects tree


Navigator : Files tree
Outline : subprograms, Functions and processes linked to the current process
Files properties : Information from GESADC (ADICTRT)
Locked Files : Locked X3 processes (*.LCKsrc)
History : history for local/SVN modifications
Help : Dynamic help
Bookmarks : To visualize marks on the source code
Problems : compilation errors, Syntax warning
Error Log : Errors, Information linked to Eclipse Plugins
Progress : Display running background tasks
Search : Files search results

Improving X3 Developer Experience with Eclipse 31


Using SAFE X3 Studio
Editor - Functionality

Editor 1
Customizable color syntax
– Window > Preferences then SAFE X3 Studio > Editor

Multi-windowing
– Switch to full screen with Ctrl + M

Completion
– Key words, global variables, system variables, templates
– Screens and tables abbreviation defined in the process (Local File, Local Mask)
– Shortcut: Ctrl + space

Auto-closing for characters : ", ', ( and [

Customizable Templates
– Window > Preferences then SAFE X3 Studio>Editor > Templates

Improving X3 Developer Experience with Eclipse 32


Using SAFE X3 Studio
Editor - Functionality

Editor 2

Comment / uncomment (Ctrl + Shift+ /) One or several lines

Indentation (Tab) one/several lines

Jump to labels and subprograms according to cursor (F3)

On the fly syntax detection with additional checks


– Parameter declaration in subprograms
– Names too long
– Verification of the abbreviation length
– Char declaration with unspecified length - New 1.2.6

Remove whitespaces at the end of lines

Improving X3 Developer Experience with Eclipse 33


Using SAFE X3 Studio
Editor - Functionality

Editor 3

Limit the line length to 200 characters. Can be set to a value between 20 and 250.
– Customizable via Window > Preferences > SAFE X3 Studio > Formatter

Multi-files navigation history (Alt + left arrow & Alt + right arrow)

Local modification history


– right-click, then Compare With > Local History...

Comparison between files


– Select a file, then the second one while holding down Ctrl key
– right-click, then Compare With > Each Other

Multi files search function (Ctrl + H) in the workspace or current project

Improving X3 Developer Experience with Eclipse 34


Using SAFE X3 Studio
Editor - Functionality

Editor 4

X3 4GL Online help available


– Hover information
– X3 Documentation View

Console: Powerful X3 Calculator


– Evaluate variable and expression
– History of commands
– Can be use to test X3 functions

Improving X3 Developer Experience with Eclipse 35


Using SAFE X3 Studio
Editor - Preferences

Preferences
Window > Preferences > Safe X3 Studio

Connection
– Timeout
– Lock refresh rate - Moved to “Locked File” section in version 1.2.6
Editor > Code Assistance
– Configure the behavior of the completion
Editor > Syntax Coloring
– Comments
– Instructions
– labels
– strings
– subprograms and functions

Improving X3 Developer Experience with Eclipse 36


Using SAFE X3 Studio
Editor - Preferences

Preferences
Window > Preferences > Safe X3 Studio

Editor > Templates


– Enable / Disable templates
– Create new one
– Import / Export
Http Service
– Configure the port number for the link with X3 Client
Locked files
– Allow manual unlock files (own locks)
– Allow manual unlock files for all files - everyone’s locks
Task Tags
– Enable / Disable Task Tags search
– New, Edit, Remove Tags

Improving X3 Developer Experience with Eclipse 37


Using SAFE X3 Studio
Editor - Shortcuts

Every developer can’t live without them!

– Open resource (files) Ctrl + Shift + R


– Open type Ctrl + Shift + T
– Completion Ctrl + Space
– Quick outline Ctrl + O
– Open declaration F3
– Toggle full screen mode Ctrl + M
– Toggle comments Ctrl + Shift + /
– Go to line Ctrl + L
– Find next / previous word Ctrl + K / Ctrl + Shift + K
– Files search Ctrl + H
– Refresh content of read only files Shift + F6
– Toggle Read only state Ctrl + Shift + F11
– Show tooltip description F2

Improving X3 Developer Experience with Eclipse 38


Using SAFE X3 Studio
Editor - Reminder

DO NOT use the « rename » function for files


Modifications will not impact the server

Delete a file from the project


Will not delete the file on the server

File > Reset object cache , button


Load the new elements

Improving X3 Developer Experience with Eclipse 39


Using SAFE X3 Studio
Debugger

Improving X3 Developer Experience with Eclipse 40


Using SAFE X3 Studio
Debugger - Standalone Process

Running a process
Running a standalone process in the context of a X3 Client

Project > Compile and Run File

Debugging a process
Debugging a standalone process in the context of a X3 Client
Project > Compile and Debug File

Be sure to have the same configuration


for Eclipse and X3 Client (Same port,
…)

Using the same solution with different


ports will drive to unexpected result.

Improving X3 Developer Experience with Eclipse 41


Using SAFE X3 Studio
Debugger - Breakpoints

Switch to Debug perspective for better experience

Breakpoint on a line with or without condition (Line breakpoint)


– Ctrl + Shift + B
– Menu Run > Toggle Breakpoint
– Double click in the margin
Break on condition (Conditional breakpoint)
– Select Breakpoint View
– Menu Run > Add Conditional Breakpoint...
Break on Error
– Select Breakpoint View
– Menu Run > Add Error Breakpoint...
Break on change of value (Watchpoint)
– Menu Run > Toggle Watchpoint

Improving X3 Developer Experience with Eclipse 42


Using SAFE X3 Studio
Debugger - Triggering

Triggering the Debugger


Attach to a process during the course of execution
– Menu Project > Attach to process or click on

– Select process, then click on « Attach »


Improving X3 Developer Experience with Eclipse 43
Using SAFE X3 Studio
Debugger - Views

Information available in Debug Mode

Window > Show View > Other...

Several Standard « Debug » Views


– Breakpoints
– Debug (Call Stack)
– Expressions, Variables
SAFE X3 Studio Debug Views
– Masks, Table information
– Memory, Variable classes information
– Processes, Sequential files information
– Trace handling
Dynamic Languages View
– Interactive Console

Improving X3 Developer Experience with Eclipse 44


Using SAFE X3 Studio
Debugger – Breakpoints View

Manage Breakpoints

– Add

– Remove / Remove All

– Modify (add one condition)

– Visualize

– Enable / Disable

Improving X3 Developer Experience with Eclipse 45


Using SAFE X3 Studio
Debugger – Debug View

Information available in Debug Mode

– Visualize the Stack

– Navigate the Stack


Improving X3 Developer Experience with Eclipse 46
Using SAFE X3 Studio
Debugger – Expression View

Manage your own expressions evaluation

– Add

– Remove / Remove All

– Modify

– Visualize Large number of values = Degraded Performance

Window > Preference > SAFE X3 Studio > Debug

– Enable / Disable evaluation Default Max children value is 50.


Tune it if necessary!

Improving X3 Developer Experience with Eclipse 47


Using SAFE X3 Studio
Debugger - Variables

Local Variables

To Modify the value of a Local Variable


– Click in the column « Value », then Right Click Change value...
OR
– Simply click the value and enter the new one
Improving X3 Developer Experience with Eclipse 48
Using SAFE X3 Studio
Debugger - Variable Classes

X3 Variable Classes [ ]

– Visualize

– Add to Watched Expressions View

Improving X3 Developer Experience with Eclipse 49


Using SAFE X3 Studio
Debugger - Trace

Follow up control flow and context changes

Activate the trace Local tracing


– On the server - With on demand content  Lots of traffic
 less performance
– Locally, directly in the view

Copy into the clipboard

Save in a file on the local machine


Improving X3 Developer Experience with Eclipse 50
Using SAFE X3 Studio
Debugger – Others Views

Monitor context information

– Memory
– Processes
– Sequential files
– Tables
– Masks

Improving X3 Developer Experience with Eclipse 51


Using SAFE X3 Studio
Debugger - Interactive Console

Take control of your runtime context

– Evaluation Console - in the context of the


« debugging » process

– Assign variables other than Local

Improving X3 Developer Experience with Eclipse 52


Using SAFE X3 Studio
Debugger - Performance

Points you need to pay attention


Many Views displayed and visible
– More data in transit
 Decrease in performance

Multi-level data evaluated (tables, variable classes)


– Potentially an enormous amount of data transferred
 Serious performance issue with high values of the Max Children parameter

Conditional Break, break on value change


– Evaluated by runtime engine for each instruction
 Decrease in performance

The Breakpoints are maintained in the Eclipse environment


– Don’t hesitate to remove all breakpoints to improve performances or restore a
clean state
Improving X3 Developer Experience with Eclipse 53
Eclipse & SAFE X3 Plug-in
Links

Improving X3 Developer Experience with Eclipse 54


Useful Links

SAFE X3 Studio site


http://pluginx3.sage.fr/safex3/studio/

OurSagePlace Blog
https://www.oursageplace.com/web/our-sage-place/safe-x3-studio-for-eclipse

OurSagePlace Forum (International)


https://www.oursageplace.com/web/our-sage-place/forum-sage-erp-negoce/-/mes
sage_boards/category/19813

OurSagePlace Wiki (Yet to come)


https://www.oursageplace.com/web/our-sage-place/safe-x3-studio-for-eclipse1

Improving X3 Developer Experience with Eclipse 55


Thank you for your attention!

Stay tuned and get the latest News:

Our Global Website Watch our YouTube Channel


SageERPX3.com youtube.com/SageERPX3
Read our Blog Join our LinkedIn Group
SageERPX3.com/blog SageERPX3.com/linkedin
Our Community Like our Facebook Page
OurSagePlace.com Facebook.com/SageERPX3
Follow us on Twitter
twitter.com/sageERPX3

Improving X3 Developer Experience with Eclipse 56

You might also like