Project

General

Profile

getting_started_with_p2j_development.html

Marius Gligor, 04/22/2014 01:01 PM

Download (14.6 KB)

 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
<html>
3
  <head>
4
    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
5
    <title>Getting Started with P2J Development</title>
6
  </head>
7
  <body style="font-family: sans-serif;">
8
    <div style="text-align: center;">
9
      <h1>Getting Started with P2J Development<br>
10
      </h1>
11
    </div>
12
    <table style="text-align: left; width: 251px; height: 79px;" border="1" cellpadding="2"
13
      cellspacing="2">
14
      <tbody>
15
        <tr>
16
          <td><small>Authors</small></td>
17
          <td><small>Greg Shah<br>
18
              Eric Faulhaber<br>
19
            </small></td>
20
        </tr>
21
        <tr>
22
          <td><small>Date</small></td>
23
          <td><small>November 29, 2013</small></td>
24
        </tr>
25
        <tr>
26
          <td><small>Access Control</small></td>
27
          <td><small>CONFIDENTIAL</small></td>
28
        </tr>
29
      </tbody>
30
    </table>
31
    <h3>Table of Contents</h3>
32
    <a href="#Introduction">Introduction</a><br>
33
    <a href="#Learning_the_Progress_4GL">Learning the Progress 4GL</a><br>
34
    <a href="#Obtaining_the_P2J_Code">Obtaining the P2J Code</a><br>
35
    <a href="#Obtaining_the_P2J_Documentation">Obtaining the P2J Documentation</a><br>
36
    <a href="#Learning_About_P2J">Learning About P2J</a><br>
37
    <a href="#Test_and_Development_Systems"></a>
38
    <h3><a name="Introduction"></a>Introduction</h3>
39
    P2J is an acronym for "Progress 4GL to Java".&nbsp; This is a source
40
    language to source language translation technology which features a fully
41
    automated conversion process and a runtime environment that provides such a
42
    high level of compatibility that the converted Java result is a drop-in
43
    replacement for the original 4GL application.<br>
44
    <br>
45
    TODO list:<br>
46
    <ol>
47
      <li>Read this document completely.&nbsp; Ask your team leader questions as
48
        needed.<br>
49
      </li>
50
      <li>If you are not already a Progress 4GL developer, <a href="#Learning_the_Progress_4GL">teach
51
          yourself the basics</a> of 4GL development. You don't need to be an
52
        expert 4GL developer, but you need to be able to read 4GL, understand
53
        what the code is doing and write programs using the most common
54
        features.<br>
55
      </li>
56
      <li>In the later stages of learning the 4GL, you may want to use P2J (<a href="#Obtaining_the_P2J_Code">get
57
          the code</a>) to convert and run 4GL sample programs.</li>
58
      <li><a href="#Learning_About_P2J">Learn about P2J</a>.</li>
59
      <li>You should be ready to pick up some P2J development tasks at this
60
        point.&nbsp; Debugging and documentation tasks will probably come first
61
        to allow you to dig into the code and work things before writing any
62
        substantial new code.<br>
63
      </li>
64
    </ol>
65
    <h3><a name="Learning_the_Progress_4GL"></a>Learning the Progress 4GL</h3>
66
    The Progress 4GL language is sometimes also called Progress OpenEdge or the
67
    Progress "Advanced Business Language"/ABL.&nbsp; Though there are newer
68
    versions, they are all just incremental differences over the original 4GL
69
    language.&nbsp; The new names are a weak marketing attempt to get people to
70
    accept the 4GL (since 4GL has a bad reputation in the market).&nbsp; We just
71
    call it by its old name of Progress 4GL. <br>
72
    <br>
73
    To "ramp-up" on the 4GL:<br>
74
    <br>
75
    <b>1.</b> Download the Progress 4GL documentation. There are 2 versions of
76
    interest: <br>
77
    <br>
78
    Progress 4GL v9.1E: <a class="moz-txt-link-freetext" href="http://download.psdn.com/documentation/openedge/pdf_zip_files/91e/progress_documentation_9.1e_pdfs.zip">http://download.psdn.com/documentation/openedge/pdf_zip_files/91e/progress_documentation_9.1e_pdfs.zip</a>
79
    <br>
80
    Progress ABL v11: <a class="moz-txt-link-freetext" href="http://download.psdn.com/documentation/openedge/pdf_zip_files/110/oepdfs.zip">http://download.psdn.com/documentation/openedge/pdf_zip_files/110/oepdfs.zip</a>.
81
    <br>
82
    <br>
83
    Most of our work will be done with the latest version of the
84
    documentation.&nbsp; However, the v9.1 versions have 2 documents that don't
85
    exist in the later versions:<br>
86
    <ul>
87
      <li>Language Tutorial for Character<br>
88
      </li>
89
      <li>Progress Handbook<br>
90
      </li>
91
    </ul>
92
    For this reason, it is important that you download the v9.1E documentation.<br>
93
    <br>
94
    <b>2.</b> Inside the 9.1E docs archive, you will find a PDF called ltu.pdf
95
    ("Language Tutorial for Character"). This is a tutorial to introduce the 4GL
96
    programming language for a Unix environment. Read this tutorial and try to
97
    get the basic idea of what 4GL code looks like and means. You aren't
98
    expected to be an expert, but it is important to be able to read code and
99
    write testcases in the language. <br>
100
    <br>
101
    <b>3.</b> Read and study the "Progress Handbook" which describes more detail
102
    on certain important language topics. This document can also be found in the
103
    9.1E archive (proghand.pdf).<br>
104
    <br>
105
    It is very useful to have the Progress 4GL Reference manual open while
106
    reading.&nbsp; This allows you to quickly read in more depth about specific
107
    language statements, built-in functions or other features.<br>
108
    <br>
109
    <b>4.</b> Write test code to ensure that you have a valid understanding of
110
    the language. You will be provided with credentials for access to a
111
    customer's 4GL development system, where you can interact with Progress 4GL
112
    directly.&nbsp; Don't spend too much time on any particular topic as the
113
    idea is just for you to be able to read and write basic programs in the 4GL
114
    language.&nbsp;
115
    If you need to write code before you have these credentials, you can write
116
    code and use P2J (<a href="#Obtaining_the_P2J_Code">get the code</a>) to
117
    convert and run these programs.&nbsp; It is important that you don't use any
118
    4GL features that are unsupported by P2J, but for the basics it should work
119
    well.<br>
120
    <br>
121
    Please ask questions early and often.&nbsp; Your team leader can help.&nbsp;
122
    Or if you have experienced P2J developers at your location, they can be
123
    invaluable.&nbsp; The Progress 4GL is strange, proprietary, inconsistent and
124
    archaic.&nbsp; It has many quirks and rough edges.&nbsp; It doesn't always
125
    make sense.&nbsp; Ask questions to speed the process by which you properly
126
    understand the language.<br>
127
    <h3><a name="Obtaining_the_P2J_Code"></a>Obtaining the P2J Code</h3>
128
    The P2J code is stored/managed in Bazaar.&nbsp; There is a subdirectory in
129
    /opt/code/ on filesrv01 which contains the project.&nbsp; Assuming that you
130
    have the Bazaar repository directory attached via sshfs as ~/repo/, the
131
    latest version of P2J can be checked out of Bazaar using this command:<br>
132
    <br>
133
    <span style="font-family: monospace;">bzr checkout ~/repo/p2j_repo/p2j</span><br>
134
    <br>
135
    This will create a <span style="font-family: monospace;">p2j/</span>
136
    subdirectory under the current directory.&nbsp; You can build it using:<br>
137
    <br>
138
    <span style="font-family: monospace;">cd p2j &amp;&amp; ant all</span><br>
139
    <br>
140
    If you have been instructed to obtain a different version of P2J (using a
141
    specific tag), then you can use this:<br>
142
    <br>
143
    <span style="font-family: monospace;">bzr checkout -r THE_TAG_TO_CHECKOUT </span><span
144
      style="font-family: monospace;">~/repo/p2j_repo/p2j</span><span style="font-family: monospace;"></span><br>
145
    <h3><a name="Obtaining_the_P2J_Documentation"></a>Obtaining the P2J
146
      Documentation</h3>
147
    The P2J documentation is stored/managed in Bazaar.&nbsp; There are two
148
    subdirectories in <tt>/opt/code/</tt> on <tt>filesrv01</tt> which contain
149
    projects.&nbsp; Assuming that you have the Bazaar repository directory
150
    attached via
151
    <tt> sshfs</tt> as <tt>~/repo/</tt>, you would see the following:<br>
152
    <br>
153
    <table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2">
154
      <tbody>
155
        <tr>
156
          <td style="vertical-align: top; text-align: center; font-weight: bold;">Path<br>
157
          </td>
158
          <td style="vertical-align: top; text-align: center; font-weight: bold;">Purpose<br>
159
          </td>
160
        </tr>
161
        <tr>
162
          <td style="vertical-align: top;"><tt>~/repo/p2j_books/conversion_handbook/</tt></td>
163
          <td style="vertical-align: top;">Describes how to setup a P2J
164
            conversion project for an application, how to configure/customize it
165
            and how to run the conversion.<br>
166
          </td>
167
        </tr>
168
        <tr>
169
          <td style="vertical-align: top;"><tt>~/repo/p2j_books/conversion_reference/</tt></td>
170
          <td style="vertical-align: top;">Provides a complete and comprehensive
171
            mapping of the Progress 4GL code that can be converted and its
172
            converted Java result.<br>
173
          </td>
174
        </tr>
175
        <tr>
176
          <td style="vertical-align: top;"><tt>~/repo/p2j_books/developer_guide/</tt></td>
177
          <td style="vertical-align: top;">Describes the P2J project from a
178
            developer's perspective.&nbsp; It also provides guidelines, tips and
179
            techniques for the future development of converted applications.<br>
180
          </td>
181
        </tr>
182
        <tr>
183
          <td style="vertical-align: top;"><tt>~/repo/p2j_books/runtime_installation_configuration_and_administration_guide/</tt></td>
184
          <td style="vertical-align: top;">Details on how to install, configure
185
            and administer converted applications and the P2J runtime.<br>
186
          </td>
187
        </tr>
188
        <tr>
189
          <td style="vertical-align: top;"><tt>~/repo/p2j_books/templates/</tt></td>
190
          <td style="vertical-align: top;">The LibreOffice book chapter
191
            template.<br>
192
          </td>
193
        </tr>
194
        <tr>
195
          <td style="vertical-align: top;"><tt>~/repo/p2j_training/developer1/</tt></td>
196
          <td style="vertical-align: top;">Class slides for the Developer 1
197
            class (the basics of how to manage and develop an application
198
            post-conversion).<br>
199
          </td>
200
        </tr>
201
      </tbody>
202
    </table>
203
    &nbsp;&nbsp;&nbsp; <br>
204
    To check out one of the above projects:<br>
205
    <br>
206
    <span style="font-family: monospace;">bzr checkout &lt;project_path&gt;</span><br>
207
    <br>
208
    Generally, there is a PDF in each directory that represents a recent "build"
209
    of the book.&nbsp; It may not be fully up to date, but it usually is good
210
    enough.<br>
211
    <h3><a name="Learning_About_P2J"></a>Learning About P2J</h3>
212
    P2J is a very complex technology that has 2 "sides": conversion and
213
    runtime.&nbsp; The conversion is an automated process of language to
214
    language translation.&nbsp; It has many aspects of compilers, translators,
215
    parsers, lexers, preprocessing, tree manipulation.&nbsp; The runtime is the
216
    compatibility environment that enables converted Java applications to run as
217
    a drop-in replacement to the original 4GL.&nbsp; This is a custom
218
    application server and clients that have extensive libraries for
219
    compatibility.&nbsp; The ramp-up time for these different and complicated
220
    technologies is non-trivial.&nbsp; The following is a list of the steps in
221
    that ramp-up:<br>
222
    <br>
223
    <b> 1.</b> Review these links on the external Golden Code website:<br>
224
    <br>
225
    <a class="moz-txt-link-freetext" href="http://www.goldencode.com/services/prog4gl/p2j/tech/conversion.html">http://www.goldencode.com/services/prog4gl/p2j/tech/conversion.html</a><br>
226
    <a class="moz-txt-link-freetext" href="http://www.goldencode.com/services/prog4gl/p2j/tech/runtime.html">http://www.goldencode.com/services/prog4gl/p2j/tech/runtime.html</a><br>
227
    <br>
228
    It also makes sense to review the rest of the pages related to this services
229
    offering, especially the FAQs:<br>
230
    <br>
231
    <a class="moz-txt-link-freetext" href="http://www.goldencode.com/services/prog4gl/p2j/faq/process.html">http://www.goldencode.com/services/prog4gl/p2j/faq/process.html</a><br>
232
    <a class="moz-txt-link-freetext" href="http://www.goldencode.com/services/prog4gl/p2j/faq/runtime.html">http://www.goldencode.com/services/prog4gl/p2j/faq/runtime.html</a><br>
233
    <br>
234
    Then send a detailed list of questions to your team leader based on this
235
    review.<br>
236
    <br>
237
    <b>2.</b> Read the <span style="font-style: italic;">P2J Developer Guide</span>
238
    (found in <tt>bzr</tt> at <tt>~/repo/p2j_books/developer_guide/</tt>).<br>
239
    <br>
240
    <b> 3.</b> Read the <span style="font-style: italic;">P2J Conversion
241
      Handbook</span> (found in <tt>bzr</tt> at <tt>~/repo/p2j_books/conversion_handbook/</tt>).&nbsp;
242
    The entire book is pretty useful, but there are parts that are more oriented
243
    as reference materials.&nbsp; Those parts can be skimmed to just get the
244
    idea.<br>
245
    <br>
246
    <b>4.</b> Read <span style="font-style: italic;">Part 2</span> of the <span
247
      style="font-style: italic;">P2J Conversion Reference</span> (found in <tt>bzr</tt>
248
    at <tt>~/repo/p2j_books/conversion_reference/</tt>). <b>Skim the rest of
249
      the book</b> to get an idea of what else is there.&nbsp; This is very good
250
    reference material. <br>
251
    <br>
252
    <b>5.</b> DO NOT bother using the <tt>p2j_project_guide.html</tt> in the
253
    root of the p2j project.&nbsp; It is far out of date.&nbsp; The P2J books
254
    listed above are the better resource.<br>
255
    <br>
256
    <b> 6.</b> Review the package.html document in the following packages of the
257
    P2J project:<br>
258
    <br>
259
    For conversion/TRPL:<br>
260
    <br>
261
    <tt>com/goldencode/p2j/pattern/package.html<br>
262
      com/goldencode/expr/package.html<br>
263
    </tt> <br>
264
    For the runtime:<br>
265
    <br>
266
    <tt>com/goldencode/p2j/security/package.html<br>
267
      com/goldencode/p2j/net/package.html<br>
268
      com/goldencode/p2j/directory/package.html</tt><br>
269
    <br>
270
    <b>7.</b> Review the classes/interfaces in the following packages to get a
271
    better understanding of the runtime code:<br>
272
    <br>
273
    <tt>com/goldencode/p2j/main/</tt>&nbsp; (this includes the bootstrapping
274
    code for both the application server and the clients)<br>
275
    <tt>com/goldencode/p2j/util/</tt>&nbsp; (most of the base language 4GL
276
    compatibility stuff is here including the data types and the
277
    block/transaction processing)<br>
278
    <tt>com/goldencode/p2j/persist/</tt> (database layer)<br>
279
    <tt>com/goldencode/p2j/ui/</tt> (user-interface layer)<br>
280
    <br>
281
    Ask LOTS of QUESTIONS of your team leader!!!<br>
282
    <br>
283
    <hr style="width: 100%; height: 2px;">
284
    <div style="text-align: right;"><i><font size="-2">?&nbsp;2007-2013 Golden
285
          Code Development Corporation.&nbsp; ALL RIGHTS RESERVED.</font></i></div>
286
  </body>
287
</html>