1 package com.proalpha.pds.templates.jet.trunk;
3 import com.openedge.pdt.core.template.TemplateGenerationException;
4 import com.proalpha.pds.templates.jet.IpaTemplateGenerator;
5 import com.proalpha.pds.templates.data.GeneratorSettingsConstans;
9 import java.text.SimpleDateFormat;
10 import com.proalpha.pds.templates.helper.CodeFormatter;
14 protected static String nl;
15 public static synchronized pAUpdateDialog create(String lineSeparator)
23 public final String NL = nl ==
null ? (System.getProperties().getProperty(
"line.separator")) : nl;
24 protected final String TEXT_1 =
"&ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r2 GUI" + NL +
"&ANALYZE-RESUME" + NL;
25 protected final String TEXT_2 = NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DECLARATIONS V-table-Win " + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */ " + NL +
"&ANALYZE-RESUME" + NL + NL;
26 protected final String TEXT_3 = NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR \"Update Information\" Procedure _INLINE" + NL +
"/* Actions: ? ? ? ? adm/support/proc/ds_pa_01.w */" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure" + NL +
"/******************************************************************************/" + NL +
"/* @COPYRIGHT@ */" + NL +
"/* Project: proALPHA */" + NL +
"/* */";
27 protected final String TEXT_4 = NL;
28 protected final String TEXT_5 = NL +
"/* */";
29 protected final String TEXT_6 = NL +
"/* Current: @PAVERSION@ as of @PADATE@/@PALASTAUTHOR@ */" + NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* DESCRIPTION */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* */";
30 protected final String TEXT_7 = NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* PARAMETERS */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Name Description */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* HISTORY */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* @FILEHISTORY@ */" + NL +
"/******************************************************************************/" + NL +
"" + NL +
"create widget-pool." + NL +
"" + NL +
"/* Procedure Information -----------------------------------------------------*/" + NL +
"" + NL +
"&GLOBAL-DEFINE pa-Autor ";
31 protected final String TEXT_8 = NL +
"&GLOBAL-DEFINE pa-Version @PAVERSION@" + NL +
"&GLOBAL-DEFINE pa-Datum @PADATE@" + NL +
"&GLOBAL-DEFINE pa-Letzter @PALASTAUTHOR@" + NL +
"" + NL +
"&GLOBAL-DEFINE pa-GenVersion OEA" + NL +
"&GLOBAL-DEFINE pa-ProgrammTyp PatchDialog" + NL +
"&GLOBAL-DEFINE pa-Template paupdatedialog.pjet" + NL +
"&GLOBAL-DEFINE pa-TemplateVersion 2.00" + NL +
"&GLOBAL-DEFINE pa-XBasisName ";
32 protected final String TEXT_9 = NL +
"&GLOBAL-DEFINE pa-NameSpace 2.00" + NL +
"" + NL +
"/* Parameters ----------------------------------------------------------------*/" + NL +
"" + NL +
"/* Globals -------------------------------------------------------------------*/" + NL +
"" + NL +
"{adm/template/incl/dt_dlg10.df}" + NL +
"" + NL +
"/* SCOPEDs -------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Definition if possible run only once (1) or several times(0) */" + NL +
"" + NL +
"&SCOPED-DEFINE K_RunOnceOnly 0" + NL +
"" + NL +
"/* Definition if the program is multi threaded */" + NL +
"" + NL +
"&SCOPED-DEFINE K_MultiThreaded 0" + NL +
"" + NL +
"/* Definition if the execution is critical (no further processing) or not */" + NL +
"" + NL +
"&SCOPED-DEFINE K_NotCritic 0" + NL +
"" + NL +
"/* Progress bar */" + NL +
"" + NL +
"&SCOPED-DEFINE K_ScreenObject gcStep" + NL +
"" + NL +
"/* Necessaries database versions */" + NL +
"/* comma separated key-value list with DBName and version, e.g: */" + NL +
"/* basis,4202,fix,42+ */" + NL +
"/* A \"+\" after the version number means all higher versions. */" + NL +
"" + NL +
"&SCOPED-DEFINE K_RequiredSchemaVersions" + NL +
"" + NL +
"/* Variables -----------------------------------------------------------------*/" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Buffers -------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Streams -------------------------------------------------------------------*/" + NL +
"" + NL +
"define stream StProtocol." + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK " + NL +
"" + NL +
"/* ******************** Preprocessor Definitions ******************** */" + NL +
"" + NL +
"&Scoped-define PROCEDURE-TYPE DIALOG-BOX" + NL +
"&Scoped-define DB-AWARE no" + NL +
"" + NL +
"/* Name of designated FRAME-NAME and/or first browse and/or first query */" + NL +
"&Scoped-define FRAME-NAME Dialog-Frame" + NL +
"" + NL +
"/* Standard List Definitions */" + NL +
"&Scoped-Define ENABLED-OBJECTS gcInfo Btn_OK Btn_Cancel gcUser gcProtocol ~" + NL +
"btnFile " + NL +
"&Scoped-Define DISPLAYED-OBJECTS gcInfo gcUser gcProtocol gcStep " + NL +
"" + NL +
"/* Custom List Definitions */" + NL +
"/* List-1,List-2,List-3,List-4,List-5,List-6 */" + NL +
"" + NL +
"/* _UIB-PREPROCESSOR-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR \"Header\" Dialog-Frame _INLINE" + NL +
"/* Actions: adm/support/proc/ds_pa_00.w ? ? ? ? */" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"/* *********************** Control Definitions ********************** */" + NL +
"" + NL +
"/* Define a dialog box */" + NL +
"" + NL +
"/* Definitions of the field level widgets */" + NL +
"define button btnFile " + NL +
" label \"Datei\":T10 " + NL +
" size 12 by 1." + NL +
"" + NL +
"define button Btn_Cancel auto-end-key " + NL +
" label \"Abbruch\":T8 " + NL +
" size 12 by 1." + NL +
"" + NL +
"define button Btn_OK auto-go " + NL +
" label \"Start\":T8 " + NL +
" size 12 by 1." + NL +
"" + NL +
"define variable gcInfo as character " + NL +
" view-as editor scrollbar-vertical" + NL +
" size 84 by 5.75 no-undo." + NL +
"" + NL +
"define variable gcProtocol as character format \"X(256)\":U " + NL +
" label \"Protokoll\":R18 " + NL +
" view-as fill-in " + NL +
" size 44 by 1 no-undo." + NL +
"" + NL +
"define variable gcStep as character format \"X(256)\":U " + NL +
" label \"aktueller Schritt\":R18 " + NL +
" view-as fill-in " + NL +
" size 62 by 1 no-undo." + NL +
"" + NL +
"define variable gcUser as character format \"X(256)\":U " + NL +
" label \"Bearbeiter\":R18 " + NL +
" view-as fill-in " + NL +
" size 44 by 1 no-undo." + NL +
"" + NL +
"" + NL +
"/* ************************ Frame Definitions *********************** */" + NL +
"" + NL +
"define frame Dialog-Frame" + NL +
" gcInfo at row 1.5 col 2 no-label" + NL +
" Btn_OK at row 12.5 col 2" + NL +
" Btn_Cancel at row 12.5 col 15" + NL +
" gcUser at row 7.5 col 21 colon-aligned" + NL +
" gcProtocol at row 8.86 col 21 colon-aligned" + NL +
" gcStep at row 10.5 col 8" + NL +
" btnFile at row 8.5 col 67" + NL +
" space(10.39) skip(3.94)" + NL +
" with view-as dialog-box keep-tab-order " + NL +
" side-labels no-underline three-d scrollable " + NL +
" title \"<insert dialog title>\":T60" + NL +
" default-button Btn_OK cancel-button Btn_Cancel drop-target." + NL +
"" + NL +
"" + NL +
"/* *********************** Procedure Settings ************************ */" + NL +
"" + NL +
"&ANALYZE-SUSPEND _PROCEDURE-SETTINGS" + NL +
"/* Settings for THIS-PROCEDURE" + NL +
" Type: DIALOG-BOX Template" + NL +
" Allow: Basic,Browse,DB-Fields,Query" + NL +
" */" + NL +
"&ANALYZE-RESUME _END-PROCEDURE-SETTINGS" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Dialog-Frame " + NL +
"/* ************************* Included-Libraries *********************** */" + NL +
"" + NL +
"{adm/method/incl/dm_upd00.lib}" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"" + NL +
"" + NL +
"/* *********** Runtime Attributes and AppBuilder Settings *********** */" + NL +
"" + NL +
"&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES" + NL +
"/* SETTINGS FOR DIALOG-BOX Dialog-Frame" + NL +
" FRAME-NAME L-To-R,COLUMNS */" + NL +
"assign " + NL +
" frame Dialog-Frame:SCROLLABLE = false" + NL +
" frame Dialog-Frame:HIDDEN = true." + NL +
"" + NL +
"assign " + NL +
" gcInfo:READ-ONLY in frame Dialog-Frame = true." + NL +
"" + NL +
"/* SETTINGS FOR FILL-IN gcStep IN FRAME Dialog-Frame" + NL +
" NO-ENABLE ALIGN-L */" + NL +
"/* _RUN-TIME-ATTRIBUTES-END */" + NL +
"&ANALYZE-RESUME" + NL +
" " + NL +
"" + NL +
"" + NL +
"" + NL +
"/* ************************ Control Triggers ************************ */" + NL +
"" + NL +
"&Scoped-define SELF-NAME Dialog-Frame" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Dialog-Frame Dialog-Frame" + NL +
"on drop-file-notify of frame Dialog-Frame /* <insert dialog title> */" + NL +
"do:" + NL +
" gcProtocol:screen-value in frame {&frame-name} = self:get-dropped-file(1)." + NL +
" self:end-file-drop()." + NL +
"end." + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Dialog-Frame Dialog-Frame" + NL +
"on window-close of frame Dialog-Frame /* <insert dialog title> */" + NL +
"do:" + NL +
" lCancelUpdate()." + NL +
" {adm/template/incl/dt_dlg09.if}" + NL +
"end." + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"&Scoped-define SELF-NAME btnFile" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btnFile Dialog-Frame" + NL +
"on choose of btnFile in frame Dialog-Frame /* Datei */" + NL +
"do:" + NL +
" define variable cTmp as character no-undo." + NL +
" define variable lOk as logical no-undo." + NL +
"" + NL +
" /* System-dialog get-file */" + NL +
"" + NL +
" cTmp = (if opsys = 'win32':U then" + NL +
" replace(gcProtocol:screen-value in frame {&FRAME-NAME},'/':U,{&PA-Backslash})" + NL +
" else" + NL +
" replace(gcProtocol:screen-value in frame {&FRAME-NAME},{&PA-Backslash},'/':U))." + NL +
"" + NL +
" {adm/incl/d__os_00.if" + NL +
" &P_CHARACTER-FIELD = \"cTmp\"" + NL +
" &P_TITLE = \"'Protokolldatei':T30\"" + NL +
" &P_CREATE-TEST-FILE = \"yes\"" + NL +
" &P_USE-FILENAME = \"yes\"" + NL +
" &P_UPDATE = \"lOk\"" + NL +
" }" + NL +
"" + NL +
" if lOk then" + NL +
" {setwidgetattr" + NL +
" \"gcProtocol\"" + NL +
" \"screen-value\"" + NL +
" \"cTmp\"" + NL +
" \"in frame {&frame-name}\"}." + NL +
" else" + NL +
" {returnnoapply}." + NL +
"end." + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"&Scoped-define SELF-NAME Btn_Cancel" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_Cancel Dialog-Frame" + NL +
"on choose of Btn_Cancel in frame Dialog-Frame /* Abbruch */" + NL +
"do:" + NL +
" lCancelUpdate()." + NL +
"end." + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"&Scoped-define SELF-NAME Btn_OK" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK Dialog-Frame" + NL +
"on choose of Btn_OK in frame Dialog-Frame /* Start */" + NL +
"do:" + NL +
"" + NL +
" /* run update */" + NL +
"" + NL +
" assign" + NL +
" gcUser" + NL +
" gcProtocol" + NL +
" ." + NL +
"" + NL +
" run runUpdate (gcUser," + NL +
" gcProtocol," + NL +
" '':U," + NL +
" '':U," + NL +
" 'ConvertData':U) no-error." + NL +
"" + NL +
" if error-status:error then" + NL +
" {returnnoapply}." + NL +
"" + NL +
"end." + NL +
" " + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"&UNDEFINE SELF-NAME" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Dialog-Frame " + NL +
"" + NL +
"" + NL +
"/* *************************** Main Block *************************** */" + NL +
"" + NL +
"gcInfo = '<INSERT INFORMATION>':T80." + NL +
"" + NL +
"{adm/template/incl/dt_dlg10.if}" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"" + NL +
"/* ********************** Internal Procedures *********************** */" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE CheckPreConditions Dialog-Frame " + NL +
"procedure CheckPreConditions :" + NL +
"/* Description ---------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* Check pre-conditions prior to run the convert */" + NL +
"/* */" + NL +
"/* Notes ---------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* Raises error condition in case of a problem */" + NL +
"/* */" + NL +
"/* All checks are processed, even if one or more fail to give a complete */" + NL +
"/* information of all problems to the user */" + NL +
"/* In case of an error, setting lStop to yes cancels convert */" + NL +
"/* */" + NL +
"/* Parameters ----------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* <none> */" + NL +
"/* */" + NL +
"/* Examples ------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* */" + NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Variables -----------------------------------------------------------------*/" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Buffers -------------------------------------------------------------------*/" + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Processing */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"lLogUpdateStep('Check pre-conditions':U,'':U,'NewBlock=yes':U)." + NL +
"" + NL +
"/*- ..... ------------------------------------------------------------------*/" + NL +
"" + NL +
"" + NL +
"end procedure. /* CheckPreConditions */" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ConvertBData Dialog-Frame " + NL +
"procedure ConvertBData :" + NL +
"/* Description ---------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* Converts Basic Data */" + NL +
"/* */" + NL +
"/* Notes ---------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* This procedure should only be used to call the procedures that implement */" + NL +
"/* the update algorithms. It should not contain any concrete conversion code. */" + NL +
"/* */" + NL +
"/* Parameters ----------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* <none> */" + NL +
"/* */" + NL +
"/* Examples ------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* */" + NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Variables -----------------------------------------------------------------*/" + NL +
"/* Define here only variables that are needed to control the procedure calls. */" + NL +
"/* Variables for concrete conversions must be moved to separate procedures */" + NL +
"/* including the code. */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Buffers -------------------------------------------------------------------*/" + NL +
"/* Buffers needed for conversion must be moved to separate procedures, */" + NL +
"/* including the code. */" + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Processing */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Disable Triggers ----------------------------------------------------------*/" + NL +
"/* ATTENTION: Do not disable triggers here, do it in your own procedure that */" + NL +
"/* will be called from this procedure. Because triggers are disabled for the */" + NL +
"/* defining procedure and all its called subprocedures. */" + NL +
"" + NL +
"lLogUpdateStep('Converts Basic Data':U,'':U,'NewBlock=yes':U)." + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Issue PA-XXXXX (Developer) -> info is important for Deployment */" + NL +
"/* Short descr or title of the issue that is implemented by this call */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* This example Code should be implementet in its own Procedure */" + NL +
"/* Example" + NL +
"" + NL +
"/*add document type ------------------------------------------------------ */" + NL +
"" + NL +
"lLogUpdateStep('Creates document type':U,'':U,'NewSection=yes':U)." + NL +
"" + NL +
"disable triggers for load of S_BelegArt." + NL +
"disable triggers for load of S_BelegArtSpr." + NL +
"" + NL +
"do transaction" + NL +
" on error undo, throw:" + NL +
" " + NL +
" find S_BelegArt" + NL +
" where S_BelegArt.BelegArt = 'MBA':U" + NL +
" exclusive-lock no-error." + NL +
"" + NL +
" if available S_BelegArt then" + NL +
" S_BelegArt.Formular = 'MBA':U." + NL +
"" + NL +
" /* UStVoa als Formular */" + NL +
"" + NL +
" find S_BelegArt" + NL +
" where S_BelegArt.BelegArt = 'FUV':U" + NL +
" no-lock no-error." + NL + NL;
33 protected final String TEXT_10 =
" if not available S_BelegArt then " + NL +
" do:" + NL +
"" + NL +
" create S_BelegArt." + NL +
" assign" + NL +
" S_BelegArt.BelegArt = 'FUV':U" + NL +
" S_BelegArt.Bereich = '':U" + NL +
" S_BelegArt.Belegtexte = no" + NL +
" S_BelegArt.Nummernkreis = no" + NL +
" S_BelegArt.Modulkennung = 'FU':U" + NL +
" S_BelegArt.Formular = '?':U" + NL +
" S_BelegArt.Tabellennamen = '':U" + NL +
" ." + NL +
"" + NL +
" create S_BelegArtSpr." + NL +
" assign" + NL +
" S_BelegArtSpr.Sprache = {&pa_DefaultSprache}" + NL +
" S_BelegArtSpr.BelegArt = 'FUV':U" + NL +
" S_BelegArtSpr.Bezeichnung = 'Umsatzsteuer-Voranmeldung':T40" + NL +
" S_BelegArtSpr.KurzBez = 'USt':T3" + NL +
" ." + NL +
" end." + NL +
"" + NL +
"end. /* do transaction */" + NL +
"" + NL +
"End of Example */" + NL +
"" + NL +
"" + NL +
"end procedure. /* ConvertBData */" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ConvertData Dialog-Frame " + NL +
"procedure ConvertData :" + NL +
"/* Description ---------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* Executes the Convert */" + NL +
"/* */" + NL +
"/* Notes ---------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* */" + NL +
"/* */" + NL +
"/* Parameters ----------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* <none> */" + NL +
"/* */" + NL +
"/* Examples ------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* */" + NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Variables -----------------------------------------------------------------*/" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Buffers -------------------------------------------------------------------*/" + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Processing */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"" + NL +
"/* Check Pre-Conditions */" + NL +
"" + NL +
"run CheckPreConditions." + NL +
"" + NL +
"/* Convert Data */" + NL +
"" + NL +
"/* run update by module */" + NL +
"" + NL +
"run ConvertBData. /* Basics */" + NL +
"" + NL +
"run ConvertMData. /* Material */" + NL +
"" + NL +
"run ConvertFData. /* Fiscal */" + NL +
"" + NL +
"end procedure. /* ConvertData */" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ConvertFData Dialog-Frame " + NL +
"procedure ConvertFData :" + NL +
"/* Description ---------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* Converts Fiscal Data */" + NL +
"/* */" + NL +
"/* Notes ---------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* This procedure should only be used to call the procedures that implement */" + NL +
"/* the update algorithms. It should not contain any concrete conversion code. */" + NL +
"/* */" + NL +
"/* Parameters ----------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* <none> */" + NL +
"/* */" + NL +
"/* Examples ------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* */" + NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Variables -----------------------------------------------------------------*/" + NL +
"/* Define here only variables that are needed to control the procedure calls. */" + NL +
"/* Variables for concrete conversions must be moved to separate procedures */" + NL +
"/* including the code. */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Buffers -------------------------------------------------------------------*/" + NL +
"/* Buffers needed for conversion must be moved to separate procedures, */" + NL +
"/* including the code. */" + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Processing */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Disable Triggers ----------------------------------------------------------*/" + NL +
"/* ATTENTION: Do not disable triggers here, do it in your own procedure that */" + NL +
"/* will be called from this procedure. Because triggers are disabled for the */" + NL +
"/* defining procedure and all its called subprocedures. */" + NL +
"" + NL +
"lLogUpdateStep('Converts Fiscal Data':U,'':U,'NewBlock=yes':U)." + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Issue PA-XXXXX (Developer) -> info is important for Deployment */" + NL +
"/* Short descr or title of the issue that is implemented by this call */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"" + NL +
"end procedure. /* ConvertFData */" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ConvertMData Dialog-Frame " + NL +
"procedure ConvertMData :" + NL +
"/* Description ---------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* Converts Material Data */" + NL +
"/* */" + NL +
"/* Notes ---------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* This procedure should only be used to call the procedures that implement */" + NL +
"/* the update algorithms. It should not contain any concrete conversion code. */" + NL +
"/* */" + NL +
"/* Parameters ----------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* <none> */" + NL +
"/* */" + NL +
"/* Examples ------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* */" + NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Variables -----------------------------------------------------------------*/" + NL +
"/* Define here only variables that are needed to control the procedure calls. */" + NL +
"/* Variables for concrete conversions must be moved to separate procedures */" + NL +
"/* including the code. */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Buffers -------------------------------------------------------------------*/" + NL +
"/* Buffers needed for conversion must be moved to separate procedures, */" + NL +
"/* including the code. */" + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Processing */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Disable Triggers ----------------------------------------------------------*/" + NL +
"/* ATTENTION: Do not disable triggers here, do it in your own procedure that */" + NL +
"/* will be called from this procedure. Because triggers are disabled for the */" + NL +
"/* defining procedure and all its called subprocedures. */" + NL +
"" + NL +
"lLogUpdateStep('Converts Material Data':U,'':U,'NewBlock=yes':U)." + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Issue PA-XXXXX (Developer) -> info is important for Deployment */" + NL +
"/* Short descr or title of the issue that is implemented by this call */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"end procedure. /* ConvertMData */" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI Dialog-Frame" + NL +
"procedure disable_UI :" + NL +
"/* Description ---------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* DISABLE the User Interface */" + NL +
"/* */" + NL +
"/* Notes ---------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* Here we clean-up the user-interface by deleting dynamic widgets we have */" + NL +
"/* created and/or hide frames. This procedure is usually called when we are */" + NL +
"/* ready to \"clean-up\" after running */" + NL +
"/* */" + NL +
"/* Parameters ----------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* <none> */" + NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Variables -----------------------------------------------------------------*/" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Buffers -------------------------------------------------------------------*/" + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Processing */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"{adm/template/incl/dt_dlg06.if}" + NL +
"" + NL +
"end procedure. /* disable_UI */" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME" + NL +
"" + NL +
"&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI Dialog-Frame" + NL +
"procedure enable_UI :" + NL +
"/* Description ---------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* ENABLE the User Interface */" + NL +
"/* */" + NL +
"/* Notes ---------------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* Here we display/view/enable the widgets in the user-interface. */" + NL +
"/* In addition, OPEN all queries associated with each FRAME and BROWSE. */" + NL +
"/* These statements here are based on the \"Other Settings\" section of the */" + NL +
"/* widget Property Sheets. */" + NL +
"/* */" + NL +
"/* Parameters ----------------------------------------------------------------*/" + NL +
"/* */" + NL +
"/* <none> */" + NL +
"/* */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Variables -----------------------------------------------------------------*/" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"/* Buffers -------------------------------------------------------------------*/" + NL +
"" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"/* Processing */" + NL +
"/*----------------------------------------------------------------------------*/" + NL +
"" + NL +
"{adm/template/incl/dt_dlg03.if}" + NL +
"" + NL +
"end procedure. /* enable_UI */" + NL +
"" + NL +
"/* _UIB-CODE-BLOCK-END */" + NL +
"&ANALYZE-RESUME";
38 public String generate(Map<String, Object> wizardSettings)
throws TemplateGenerationException
40 final StringBuffer stringBuffer =
new StringBuffer();
46 String module = (String)wizardSettings.get(
"Module");
49 String xbasename = fileName.replace(
".",
"_");
50 Date date =
new Date();
51 SimpleDateFormat year =
new SimpleDateFormat(
"yyyy");
52 SimpleDateFormat today =
new SimpleDateFormat(
"dd.MM.yyyy");
53 stringBuffer.append(TEXT_1);
54 if ((fileName.endsWith(
".p")) || (fileName.endsWith(
".w") || (fileName.endsWith(
".cls"))))
56 stringBuffer.append(TEXT_2);
58 stringBuffer.append(TEXT_3);
59 stringBuffer.append(TEXT_4);
60 stringBuffer.append(
CodeFormatter.SingleLineComment(
"Name : " + fileName));
61 stringBuffer.append(TEXT_4);
62 stringBuffer.append(
CodeFormatter.SingleLineComment(
"Product: " + product +
" - " + productDesc ));
63 stringBuffer.append(TEXT_4);
64 stringBuffer.append(
CodeFormatter.SingleLineComment(
"Module : " + module +
" - " + moduleDesc ));
65 stringBuffer.append(TEXT_5);
66 stringBuffer.append(TEXT_4);
67 stringBuffer.append(
CodeFormatter.SingleLineComment(
"Created: " + version +
" as of " + today.format(date) +
"/" + author));
68 stringBuffer.append(TEXT_6);
69 stringBuffer.append(TEXT_4);
70 stringBuffer.append(
CodeFormatter.MultiLineComment(description));
71 stringBuffer.append(TEXT_7);
72 stringBuffer.append(author);
73 stringBuffer.append(TEXT_8);
74 stringBuffer.append(xbasename);
75 stringBuffer.append(TEXT_9);
76 stringBuffer.append(TEXT_10);
77 stringBuffer.append(TEXT_4);
78 return stringBuffer.toString();