Tutorial Plex
From Plex-XML
Tutorial workflow: Plex-XML tutorial main page → Preparing your environment → Extract the tutorial from CVS → Restore the tutorial DB → Tutorial Plex → Tutorial Eclipse → Tutorial application user guide → Tutorial debug → Tutorial Log → Help text Wiki
Welcome to the first Plex part of your tutorial
In this part we are going to extent the basic Plex tutorial model you might already know from your Plex lessons by the Plex_XML pattern.
Contents |
Prepare our Plex-Model for first usage
- Open Eclipse and make sure you are in the Java perspective of Eclipse. If you are not sure you should navigate in the Eclipse menu to Window/Open_Perspective and select the Java Perspective. If you can not find it there choose "Other..." and select the Java perspective from the entries in the window that has just opened.
- Please do not edit the Plex tutorial model in your Eclipse workspace.
- Open the Tutorial project in the PackageExplorer of Eclipse and copy the 'Plex-Tutorial/Tutorial_Java' model from Eclipse to a local directory like c:\Cool550MDL\Tutorial_Java. If you need to use another path you have adjust some configuration properties later in the Eclipse part.
- Open the local model "c:\Cool550MDL\TUTORIAL_JAVA.MDL" with Plex
- OPTIONAL STEP: Update your Plex-XML pattern from the group model (if available)
- If you have access to the Plex-XML group models you might want to use the latest versions of the patterns.
- Login to the group model that is located in the 'grp' subdirectory. As you can see beside the normal pattern libraries there are some pattern used for Plex-XML. (Plex tries to find some pattern libraries on the path "M:\...."; You can find them on the path your group models are stored instead (e.g. "O:\Cool550MDL\...."))
- Extract from all libraries to get the latest version of the pattern, close the group model and save the local model.
Inherit from Plex-XML pattern
- Enter the following inheritance triples to get some business base functions from an all about pattern. Theses pattern fits very easy into the rest of the Plex-XML pattern. But with just a little effort you could replace this pattern with you own business logic pattern.
- Employee is a SEC_V20/aaBusinessBaseOhneStd
- Project is a SEC_V20/aaBusinessBaseOhneStd
- After that we inherit the logic to get XML out of Plex in two different ways:
- In the first version business and presentation logic is in the same entity:
- Employee is a PLEXML_A/aaXMLBase
- Employee.XML_Intern replaces ENT Employee.AbstractData
- ...by Employee
- In the second version business and presentaion logic is in two seperate entities or in two modells. The advantage of the this version is the seperation of logic. Now it is easy to build another presentaiton model and to reuse the business logic.
- Project_XML is a PLEXML_A/aaXMLBase
- Project_XML.XML_Intern replaces ENT Project_XML.AbstractData
- ...by Project
Thereafter your Object Browser and your Model Editor should be able to show this:
- Assign 'impl name' and 'file name' triple to the XML-Functions
- Employee.XML_Intern.Dictionary.Insert file name Employee_IN
- Employee.XML_Intern.Dictionary.Insert impl name Employee_IN
- Employee.XML_Intern.Dictionary.Update file name Employee_UD
- Employee.XML_Intern.Dictionary.Update impl name Employee_UD
- Employee.XML_Intern.FindBrowse.FindBrowse file name Employee_FB
- Employee.XML_Intern.FindBrowse.FindBrowse impl name Employee_FB
- Project_XML.XML_Intern.Dictionary.Insert file name Project_IN
- Project_XML.XML_Intern.Dictionary.Insert impl name Project_IN
- Project_XML.XML_Intern.Dictionary.Update file name Project_UD
- Project_XML.XML_Intern.Dictionary.Update impl name Project_UD
- Project_XML.XML_Intern.FindBrowse.FindBrowse file name Project_FB
- Project_XML.XML_Intern.FindBrowse.FindBrowse impl name Project_FB
Prepare Java generation
- Select "Package" in the combo box in your Model Editor
- Enter the packages that will contain your Java-Functions
- Hint: If you get the message that a "com" package already exists you could enter a xcom package and rename it afterwards to com.
- Hint: If you get a dialog window to select an existing package (e.g. db should already exist in other group model's) press cancel and you'll get a new one.
- com contains PKG plexxml
- plexxml contains PKG db
- plexxml contains PKG server
- plexxml contains PKG xml
- Assign your functions to the packages
- db contains TBL Employee.Physical table
- db contains VW Employee.Fetch
- db contains VW Employee.Update
- db contains VW Employee.FindBrowse
- db contains TBL Project.Physical table
- db contains VW Project.Fetch
- db contains VW Project.Update
- db contains VW Project.FindBrowse
- server contains FNC Employee.BusinessBaseFunctions
- server contains FNC Employee.BusinessExtraFunctions
- server contains FNC Project.BusinessBaseFunctions
- server contains FNC Project.BusinessExtraFunctions
- xml contains ENT Employee.XML_Intern
- xml contains ENT Project_XML.XML_Intern
- The presentation, business and database logic is now distributed in different Java packages.
- While each of your XML-Functions needs a real surrogate number from Plex you should update your group model now.
Generate
- Open the Gen&Build window and set the default 'Gen' path in the options dialog. While that path name is used later in the Ant-Task that copies your files form Plex to Eclipse you should not change it.
- HINT: If your model path is not 'c:\cool550mdl\Tutorial_Java' you need to change it here and in the 'Name Allocation' section.
- Generate not build your functions (e.g. you could drag the com package in the gen and build window). 45 tabels, views and functions should be generated.
Next Step in the Tutorial
- At this point we are done with Plex and entering the Eclipse tutorial.




