Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
de:jvx:firstapp [2018/01/25 09:53]
admin created
de:jvx:firstapp [2018/01/29 14:11] (current)
admin
Line 1: Line 1:
-In the following paragraphs, we will show you how to create your first JVx application with minimal effort and code.+~~Title: Erste JVx Applikation~~
  
-The application'​s task is to display data from a database table and make the data editable+In den folgenden Absätzen zeigen wir Ihnen wie Sie mit wie wenig Aufwand und Code ihre erste JVx Applikation erstellen können.
  
-Before you start you will need the following libraries and tools:+Die Aufgabe der Applikation ist, die Daten aus einer Datenbanktabelle darzustellen und bearbeitbar zu machen. ​
  
-  * [[http://​sourceforge.net/​projects/​jvx/​files/​latest/​download|JVx Binary package]] +Vor dem Start benötigen Sie folgende Libraries und Werkzeuge:
-  * Eclipse IDE (>= 3.4) with JDT (recommended:​ Eclipse IDE for Java EE developers) +
-  * JDK 6.0 (1.6) or higher +
-  * HSQLDB library (http://​www.hsqldb.org) +
-  * [[http://​sourceforge.net/​projects/​jvxfirstapp/​files/​latest/​download|JVx sample Eclipse project]]+
  
-For our JVx sample application we need the following parts:+  * [[http://​sourceforge.net/​projects/​jvx/​files/​latest/​download|JVx Binärpaket]] 
 +  * Eclipse IDE (>= 3.4) mit JDT (Empfohlen wirdEclipse IDE für Java EE Entwickler) 
 +  * JDK 6.0 (1.6) oder höher 
 +  * HSQLDB Bibliothek (http://​www.hsqldb.org) 
 +  * [[http://​sourceforge.net/​projects/​jvxfirstapp/​files/​latest/​download|JVx Beispiel Eclipse Projekt]]
  
-  ​* [[#​application|Application]] +Für unsere JVx Beispiel Applikation benötigen wir folgende Teile: 
-  * [[#​workscreen|Work screen]] + 
-  * [[#​workscreen|Business ​object]] +  ​* [[#​application|Applikation]] 
-  * [[#​database|Database connection]]+  * [[#​workscreen|Workscreen]] 
 +  * [[#​workscreen|Business ​Objekt]] 
 +  * [[#​database|Datenbankverbindung]]
  
 {{anchor:​application:​}} {{anchor:​application:​}}
-== Create an application ​== +== Erstellen einer Applikation ​== 
  
-We need an application as a frame for the clientEach application must implement the interface ​''​javax.rad.application.IApplication''​. ​In our example, we derive from the standard implementation ​''​com.sibvisions.rad.application.Application'', ​whereby we use the following code:+Für den Client benötigen wir eine Applikation als RahmenJede Applikation muss das Interface ​''​javax.rad.application.IApplication'' ​implementierenWir leiten uns in unserem Beispiel von der Standard Implementierung ​''​com.sibvisions.rad.application.Application'' ​abwobei wir folgenden Code verwenden:
  
 <file java FirstApplication.java>​ <file java FirstApplication.java>​
Line 137: Line 139:
 </​file>​ </​file>​
  
-Method ​Description ​+Methode ​Beschreibung ​
-|Constructor|A specific constructor is neededas each application is started with a  launcher which depends on the technology usedThis launcher is passed over to the application in the constructor.| +|Konstruktor|Es wird ein eigener Konstruktor benötigtda jede Applikation mit einem Technologieabhängigen Launcher gestartet wirdDieser Launcher wird bereits im Konstruktor an die Applikation übergeben.| 
-|createConnection|The communication protocol is initialised''​DirectServerConnection'' ​is sufficient for our applicationas both the client and the server are started ​in the same VM. However, if an application server is integrated, a ''​HttpConnection'' ​could also be used.| +|createConnection|Das Kommunikationsprotokoll wird initialisiertFür unsere Applikation ist eine ''​DirectServerConnection'' ​ausreichendda sowohl Client als auch Server ​in der selben ​VM gestartet werdenWird jedoch ein Applikationsserver eingesetzt könnte alternativ eine ''​HttpConnection'' ​verwendet werden.| 
-|getApplicationName|Sets the application nameThis name is needed for the communication with the serveras the latter uses the appropriate application configuration depending on the application name. In our case, the application name must be firstapp ​as the working directory is also called ​''​../​JVxFirstApp/​rad/​**firstapp**/''​.| +|getApplicationName|Legt den Applikationsnamen festDieser Name wird für die Kommunikation mit dem Server benötigtda dieser abhängig vom Applikationsnamen die passende Applikationskonfiguration verwendet. In unserem Fall muss der Applikationsname ​firstapp ​lauten, da das Arbeitsverzeichnis ​''​../​JVxFirstApp/​rad/​**firstapp**/'' ​ebenso lautet..| 
-|afterLogin|This method is called by the super class after a successful loginWe use this method to extend our menu and our toolbar.\\ \\ It is not necessary to reset the changes after logoutas this is done automatically by the super class.| +|afterLogin|Diese Methode wird von der Superklasse aufgerufen, nachdem eine erfolgreiche Anmeldung durchgeführt wurdeWir verwenden diese Methode um unser Menü und unsere ToolBar zu erweitern.\\ \\ Es ist nicht nötig nach der Abmeldung die Änderungen rückgängig zu machenda dies von der Superklasse übernommen wird.| 
-|createMenuItem|Provided by the super class to create menu entriesThe first parameter contains the name of the method which is to be called when the menu entry is selectedThe second parameter contains the command ​(ActionCommand) ​which plays no role in our caseThe text of the menu entry is to be defined in the third parameter, and lastly the image for the entry is passed over.| +|createMenuItem|Wird von der Superklasse bereitgestellt um Menü Einträge zu erstellenDer erste Parameter enthält die Bezeichnung der Methode die aufgerufen werden soll wenn der Menü Eintrag gedrückt wirdDer zweite Parameter enthält den Befehl ​(ActionCommand) ​der in unserem Fall keine Rolle spieltIm dritten Parameter ist der Text des Menü Eintrags zu definieren und abschließend wird das Bild für den Eintrag übergeben.| 
-|createToolBarButton|Similar to ''​createMenuItem'', ​except that this method creates a button which adapts to the layout of the toolbar.| +|createToolBarButton|Ähnlich wie ''​createMenuItem'' ​nur wird hierbei ein Button erzeugtder sich dem Layout der ToolBar anpasst.| 
-|UIImage.getImage|Provides a predefined image from the JVx image libraryFor ease of use, we use a predefined image.| +|UIImage.getImage|Liefert ein vordefiniertes Bild aus der Bild Bibliothek von JVx. \\ Wir verwenden zwecks Komfort ein vordefiniertes Bild.| 
-|doOpenDBEdit|This method is called when the menu or the toolbar button are pressed and calls the corresponding work screen.| +|doOpenDBEdit|Diese Methode wird aufgerufen wenn das Menü oder der ToolBar Button gedrückt werden und ruft den entsprechenden Workscreen auf.| 
-|configureFrame|This method is provided by the super class and ensures that all frames look the sameThis includes the menu icon.|+|configureFrame|Diese Methode wird von der Superklasse bereitgestellt und sorgt dafür, dass alle Frames einheitlich aussehenDazu zählt unter anderem das Menü Icon.|
  
 {{anchor:​workscreen:​}} {{anchor:​workscreen:​}}
-== Create a work screen ​== +== Erstellen eines Workscreens ​== 
  
-Once we have created the application frameworkwe now reate our first work screen with the following code:+Nachdem wir den Applikationsrahmen fertig erstellt habenerstellen wir nun unseren ersten Workscreen mit folgenden Code:
  
 <file java DBEditFrame.java>​ <file java DBEditFrame.java>​
Line 259: Line 261:
 </​file>​ </​file>​
  
-Method ​Description ​+Methode ​Beschreibung ​
-|initializeModel|Initialises the client objects for the access to the server or the data.| +|initializeModel|Instanziert die Client Objekte für den Zugriff auf den Server bzw. die Daten.| 
-|InitializeUI|Layouting ​of the work screen.| +|InitializeUI|Layouting ​des WorkScreen.| 
-|createSubConnection|We create a separate connection to the serverThis has the advantage that a separate business object is used on the serverThis object contains all objects needed by the work screen. Once the work screen is closedthe used memory is releasedMoreovereach connection can have special parameters and time outs. \\ The requested business object is defined with the following class: ''​apps.firstapp.frames.DBEdit''​. \\ \\ The class will be created later on.|+|createSubConnection|Wir erstellen eine eigene Verbindung zum ServerDas hat den Vorteil, dass am Server ein eigenes Business Objekt verwendet wirdDieses Objekt hält alle Objektedie vom WorkScreen benötigt werdenNachdem der WorkScreen geschlossen wirdwird auch der benutzte Speicher wieder freigeben. Weiters kann jede Verbindung spezielle Parameter und Timeouts haben.. \\ Das gewünschte Business Objekt wird mit der Klassenbezeichnung definiert: ''​apps.firstapp.frames.DBEdit''​. \\ \\ Die Klasse erstellen wir im Anschluß.|
  
-^ Member ^ Description ​+^ Member ^ Beschreibung ​
-|connection|The connection to the serverspecially ​ for the work screenA special communication protocol is used in the background. In our case, it mirrors the ''​DirectServerConnection'' ​class.| +|connection|TDie Verbindung zum Serverspeziell für den WorkScreenIm Hintergrund wird ein spezielles Kommunikationsprotokoll verwendet. In unserem Fall spiegelt dieses die Klasse ​''​DirectServerConnection'' ​wieder.| 
-|dataSource|This is the data source and looks after the transfer of data between the client and the serverThe connection ​is used for the transfer.| +|dataSource|Die DataSource ist die Datenquelle und kümmert sich um die Übertragung der Daten zwischen Client und ServerFür den Transfer wird die connection ​verwendet.| 
-|rdbContacts|The model and the controller for data display. \\ The name contacts ​defines under which name the server-side business object can be found.|+|rdbContacts|Das Model und der Controller für die Datenanzeige. \\ Der Name contacts ​legt fest unter welchen Namen das serverseitige Business Objekt zu finden ist.|
  
 {{anchor:​business:​}} {{anchor:​business:​}}
-== Create a business object ​==+== Erstellen des Business Objekts ​==
  
-Once we have created the clientwe need the corresponding business object on the serverso as to define the source of the data more preciselyTo do so, we use the following code:+Nachdem wir den Client fertig erstellt habenbenötigen wir am Server noch das dazugehörige Business Objektum die Quelle der Daten näher zu definierenDazu verwenden wir folgenden Code:
  
 <file java DBEdit.java>​ <file java DBEdit.java>​
Line 321: Line 323:
 </​file>​ </​file>​
  
-Description ​+Beschreibung ​
-|The class mirrors the business object for the ''​DBEditFrame'' ​work screenThe objects can only be accessed via the SubConnection ​of the work screen. \\ Through the class derivation of ''​apps.firstapp.Session''​, it is very easy to access all objects of the Session ​and the ''​Application''​.|+|Die Klasse spiegelt das Business Objekt für den ''​DBEditFrame'' ​WorkScreen wiederAuf die Objekte kann ausschließlich über die ''​SubConnection''​ des WorkScreens zugegriffen werden. \\ \\ Durch die Ableitung von ''​apps.firstapp.Session'' ​kann auf einfachste Art und Weise auf sämtliche Objekte der ''​Session''​ und der ''​Application'' ​zugegriffen werden.|
  
-Method ​Description ​+Methode ​Beschreibung ​
-|getContacts|Enables the access to the database tablee ​''​CONTACTS''​. ​The method name must match the object name of the RemoteDataBook:​ ''​contacts => getContacts''​. \\ \\ Exception ​handling is taken over by the server.|+|getContacts|Ermöglicht den Zugriff auf die Datenbanktabelle ​''​CONTACTS''​. ​Der Methodenname muss dem Objektnamen des RemoteDataBook ​entsprechen: ''​contacts => getContacts''​. \\ \\ Das Exception ​Handling wird vom Server übernommen.|
  
 {{anchor:​database:​}} {{anchor:​database:​}}
-== Create a database connection ​==+== Erstellen der Datenbankverbindung ​==
  
-In the business object, we referred to the data source with the method ''​getDBAccess()''​. In our case we use a HyperSQL ​databaseWe define the database connection in the following class:+Im Business Objekt haben wir mit der Methode ​getDBAccess() ​auf die Datenquelle verwiesen. In unserem Fall verwenden wir eine HyperSQL ​DatenbankIn folgender Klasse definieren wir die Datenbankverbindung:
  
 <file java Session.java>​ <file java Session.java>​
Line 377: Line 379:
 </​file>​ </​file>​
  
-Method ​Description ​+Methode ​Beschreibung ​
-|getDBAccess|Opens a new connection to a HSQL databaseif this has not yet occurred. \\ \\ Exception ​handling is taken on by the server.|+|getDBAccess|Öffnet eine neue Verbindung zu einer HSQL Datenbankfalls dies nicht bereits geschehen ist. \\ \\ Das Exception ​Handling wird vom Server übernommen.|
 \\  \\ 
-The application is now fully implemented and ready to runTo be able to work with the application we need the database including the ''​CONTACTS'' ​table which we want to accessIt has already been created in the Eclipse ​project and can be started with ''​../​JVxFirstApp/​db/​startHSqlDB.bat''​.+Die Applikation ist jetzt vollständig implementiert und lauffähigDamit wir nun mit der Applikation arbeiten können benötigen wir die Datenbank inklusive Tabelle ​''​CONTACTS'' ​auf die wir zugreifen wollenDiese ist im Eclipse ​Projekt bereits erstellt worden und kann mit ''​../​JVxFirstApp/​db/​startHSqlDB.bat'' ​gestartet werden.
  
-== The first JVx application ​==+== Die erste JVx Applikation ​==
  
-Once the database has been startedthe application can be started via the Run menu in Eclipse. ​The finished application should now look as follows:+Nachdem die Datenbank gestartet wurdekann die Applikation über das Run Menü von Eclipse ​gestartet werdenDie fertige Applikation sollte nun wie folgt aussehen:
  
 {{:​jvx:​app_finished.png?​nolink|}} {{:​jvx:​app_finished.png?​nolink|}}
  
-You can find more details about the components of a JVx application as well as step by step instructions for Eclipse ​under [[jvx:​firstapp_step-by-step|Step by step introductions to the JVx application]].+Mehr Details zu den Bestandteilen einer JVx Applikation sowie eine Schritt für Schritt ​Eclipse ​Anleitung finden sie unter [[de:jvx:​firstapp_step-by-step|Schritt für Schritt Anleitung zur JVx Applikation]].
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information