Refactor Nexacro project structure and remove deprecated forms

- Updated project XML and type definition files to remove leading slashes from URLs.
- Changed form references in the project to use the new Base directory instead of Forms.
- Deleted unused forms: frmConsolidation, frmLogin, frmMasterData, frmReportsOps, frmUploadValidation.
- Adjusted generator script to reflect new directory structure and ensure proper file generation.
This commit is contained in:
DongHeon Jang 2026-04-16 23:12:33 +09:00
parent 75a786f681
commit d964b65f0a
13 changed files with 45 additions and 52 deletions

View File

@ -52,6 +52,7 @@ this.actRunConsolidation = function(obj, e)
<Grid id="grdRuns" taborder="1" left="36" top="176" width="1368" height="360" binddataset="dsRuns"> <Grid id="grdRuns" taborder="1" left="36" top="176" width="1368" height="360" binddataset="dsRuns">
<Formats><Format id="default"><Columns><Column size="195"/><Column size="195"/><Column size="195"/><Column size="195"/><Column size="195"/><Column size="195"/><Column size="195"/></Columns><Rows><Row size="32" band="head"/><Row size="28"/></Rows><Band id="head"><Cell col="0" text="실행ID"/><Cell col="1" text="회계기간"/><Cell col="2" text="상태"/><Cell col="3" text="요청자"/><Cell col="4" text="요청시각"/><Cell col="5" text="완료시각"/><Cell col="6" text="요약"/></Band><Band id="body"><Cell col="0" text="bind:id"/><Cell col="1" text="bind:fiscalPeriod"/><Cell col="2" text="bind:statusCode"/><Cell col="3" text="bind:requestedBy"/><Cell col="4" text="bind:requestedAt"/><Cell col="5" text="bind:finishedAt"/><Cell col="6" text="bind:summaryMessage"/></Band></Format></Formats> <Formats><Format id="default"><Columns><Column size="195"/><Column size="195"/><Column size="195"/><Column size="195"/><Column size="195"/><Column size="195"/><Column size="195"/></Columns><Rows><Row size="32" band="head"/><Row size="28"/></Rows><Band id="head"><Cell col="0" text="실행ID"/><Cell col="1" text="회계기간"/><Cell col="2" text="상태"/><Cell col="3" text="요청자"/><Cell col="4" text="요청시각"/><Cell col="5" text="완료시각"/><Cell col="6" text="요약"/></Band><Band id="body"><Cell col="0" text="bind:id"/><Cell col="1" text="bind:fiscalPeriod"/><Cell col="2" text="bind:statusCode"/><Cell col="3" text="bind:requestedBy"/><Cell col="4" text="bind:requestedAt"/><Cell col="5" text="bind:finishedAt"/><Cell col="6" text="bind:summaryMessage"/></Band></Format></Formats>
</Grid> </Grid>
<Static id="staMessage0" taborder="900" left="36" top="824" width="1368" height="20" text="업로드가 ACCEPTED 상태인 파일만 집계 대상에 포함됩니다."/>
<Layouts> <Layouts>
<Layout width="1440" height="900" screenid="Desktop_screen"/> <Layout width="1440" height="900" screenid="Desktop_screen"/>
</Layouts> </Layouts>

View File

@ -39,10 +39,11 @@ this.actLogin = function(obj, e)
]]></Script> ]]></Script>
<Static id="staTitle" taborder="0" left="88" top="72" width="460" height="64" text="Hanwha Nexacro Demo"/> <Static id="staTitle" taborder="0" left="88" top="72" width="460" height="64" text="Hanwha Nexacro Demo"/>
<Static id="staSubtitle" taborder="1" left="88" top="148" width="460" height="28" text="업로드/검증 중심 재무 통합 데모"/> <Static id="staSubtitle" taborder="1" left="88" top="148" width="460" height="28" text="업로드/검증 중심 재무 통합 데모"/>
<Edit id="edtUsername" taborder="2" left="88" top="248" width="320" height="44" displaynulltext="사용자 ID" value="bind:username"/> <Edit id="edtUsername" taborder="2" left="88" top="248" width="320" height="44" displaynulltext="사용자 ID"/>
<Edit id="edtPassword" taborder="3" left="88" top="308" width="320" height="44" displaynulltext="비밀번호" value="bind:password" password="true"/> <Edit id="edtPassword" taborder="3" left="88" top="308" width="320" height="44" displaynulltext="비밀번호" password="true"/>
<Button id="btnLogin" taborder="4" left="88" top="376" width="320" height="48" text="로그인"/> <Button id="btnLogin" taborder="4" left="88" top="376" width="320" height="48" text="로그인"/>
<Static id="staMessage0" taborder="900" left="36" top="824" width="1368" height="20" text="기본 계정 admin/operator/viewer, 비밀번호 demo1234"/>
<Layouts> <Layouts>
<Layout width="1440" height="900" screenid="Desktop_screen"/> <Layout width="1440" height="900" screenid="Desktop_screen"/>
</Layouts> </Layouts>

View File

@ -75,6 +75,7 @@ this.txLoadReference = function(obj, e)
<Grid id="grdOwnership" taborder="1" left="708" top="410" width="696" height="260" binddataset="dsOwnership"> <Grid id="grdOwnership" taborder="1" left="708" top="410" width="696" height="260" binddataset="dsOwnership">
<Formats><Format id="default"><Columns><Column size="232"/><Column size="232"/><Column size="232"/></Columns><Rows><Row size="32" band="head"/><Row size="28"/></Rows><Band id="head"><Cell col="0" text="모법인"/><Cell col="1" text="자법인"/><Cell col="2" text="지분율"/></Band><Band id="body"><Cell col="0" text="bind:parentEntityCode"/><Cell col="1" text="bind:childEntityCode"/><Cell col="2" text="bind:ownershipRatio"/></Band></Format></Formats> <Formats><Format id="default"><Columns><Column size="232"/><Column size="232"/><Column size="232"/></Columns><Rows><Row size="32" band="head"/><Row size="28"/></Rows><Band id="head"><Cell col="0" text="모법인"/><Cell col="1" text="자법인"/><Cell col="2" text="지분율"/></Band><Band id="body"><Cell col="0" text="bind:parentEntityCode"/><Cell col="1" text="bind:childEntityCode"/><Cell col="2" text="bind:ownershipRatio"/></Band></Format></Formats>
</Grid> </Grid>
<Static id="staMessage0" taborder="900" left="36" top="824" width="1368" height="20" text="기준정보, 계정, 환율, 지분율을 확인합니다."/>
<Layouts> <Layouts>
<Layout width="1440" height="900" screenid="Desktop_screen"/> <Layout width="1440" height="900" screenid="Desktop_screen"/>
</Layouts> </Layouts>

View File

@ -57,6 +57,7 @@ this.txLoadReports = function(obj, e)
<Grid id="grdJobLogs" taborder="1" left="36" top="420" width="1368" height="320" binddataset="dsJobLogs"> <Grid id="grdJobLogs" taborder="1" left="36" top="420" width="1368" height="320" binddataset="dsJobLogs">
<Formats><Format id="default"><Columns><Column size="228"/><Column size="228"/><Column size="228"/><Column size="228"/><Column size="228"/><Column size="228"/></Columns><Rows><Row size="32" band="head"/><Row size="28"/></Rows><Band id="head"><Cell col="0" text="로그ID"/><Cell col="1" text="작업유형"/><Cell col="2" text="참조ID"/><Cell col="3" text="레벨"/><Cell col="4" text="메시지"/><Cell col="5" text="생성시각"/></Band><Band id="body"><Cell col="0" text="bind:id"/><Cell col="1" text="bind:jobType"/><Cell col="2" text="bind:referenceId"/><Cell col="3" text="bind:logLevel"/><Cell col="4" text="bind:logMessage"/><Cell col="5" text="bind:createdAt"/></Band></Format></Formats> <Formats><Format id="default"><Columns><Column size="228"/><Column size="228"/><Column size="228"/><Column size="228"/><Column size="228"/><Column size="228"/></Columns><Rows><Row size="32" band="head"/><Row size="28"/></Rows><Band id="head"><Cell col="0" text="로그ID"/><Cell col="1" text="작업유형"/><Cell col="2" text="참조ID"/><Cell col="3" text="레벨"/><Cell col="4" text="메시지"/><Cell col="5" text="생성시각"/></Band><Band id="body"><Cell col="0" text="bind:id"/><Cell col="1" text="bind:jobType"/><Cell col="2" text="bind:referenceId"/><Cell col="3" text="bind:logLevel"/><Cell col="4" text="bind:logMessage"/><Cell col="5" text="bind:createdAt"/></Band></Format></Formats>
</Grid> </Grid>
<Static id="staMessage0" taborder="900" left="36" top="824" width="1368" height="20" text="batch가 생성한 Excel/PDF를 내려받고 최근 로그를 확인합니다."/>
<Layouts> <Layouts>
<Layout width="1440" height="900" screenid="Desktop_screen"/> <Layout width="1440" height="900" screenid="Desktop_screen"/>
</Layouts> </Layouts>

View File

@ -56,7 +56,7 @@ this.actUpload = function(obj, e)
]]></Script> ]]></Script>
<Combo id="cboTemplate" taborder="0" left="36" top="108" width="220" height="38" codecolumn="code" datacolumn="label"/> <Combo id="cboTemplate" taborder="0" left="36" top="108" width="220" height="38" codecolumn="code" datacolumn="label"/>
<Edit id="edtFiscalPeriod" taborder="1" left="274" top="108" width="140" height="38" displaynulltext="회계기간 (YYYY-MM)"/> <Edit id="edtFiscalPeriod" taborder="1" left="274" top="108" width="140" height="38" displaynulltext="회계기간 (YYYY-MM)"/>
<FileUpload id="fileUpload" taborder="2" left="432" top="108" width="480" height="38"/> <Edit id="fileUpload" taborder="2" left="432" top="108" width="480" height="38" displaynulltext="업로드 파일" readonly="true"/>
<Button id="btnUpload" taborder="3" left="930" top="108" width="140" height="38" text="파일 업로드"/> <Button id="btnUpload" taborder="3" left="930" top="108" width="140" height="38" text="파일 업로드"/>
<Button id="btnReloadUploads" taborder="4" left="1086" top="108" width="140" height="38" text="내역 새로고침"/> <Button id="btnReloadUploads" taborder="4" left="1086" top="108" width="140" height="38" text="내역 새로고침"/>
<Static id="sta_grdUploadBatches" taborder="0" left="36" top="148" width="1368" height="24" text="업로드 이력"/> <Static id="sta_grdUploadBatches" taborder="0" left="36" top="148" width="1368" height="24" text="업로드 이력"/>
@ -67,6 +67,7 @@ this.actUpload = function(obj, e)
<Grid id="grdIssues" taborder="1" left="36" top="486" width="1368" height="300" binddataset="dsIssues"> <Grid id="grdIssues" taborder="1" left="36" top="486" width="1368" height="300" binddataset="dsIssues">
<Formats><Format id="default"><Columns><Column size="342"/><Column size="342"/><Column size="342"/><Column size="342"/></Columns><Rows><Row size="32" band="head"/><Row size="28"/></Rows><Band id="head"><Cell col="0" text="행번호"/><Cell col="1" text="오류코드"/><Cell col="2" text="오류메시지"/><Cell col="3" text="등급"/></Band><Band id="body"><Cell col="0" text="bind:rowNumber"/><Cell col="1" text="bind:issueCode"/><Cell col="2" text="bind:issueMessage"/><Cell col="3" text="bind:severityCode"/></Band></Format></Formats> <Formats><Format id="default"><Columns><Column size="342"/><Column size="342"/><Column size="342"/><Column size="342"/></Columns><Rows><Row size="32" band="head"/><Row size="28"/></Rows><Band id="head"><Cell col="0" text="행번호"/><Cell col="1" text="오류코드"/><Cell col="2" text="오류메시지"/><Cell col="3" text="등급"/></Band><Band id="body"><Cell col="0" text="bind:rowNumber"/><Cell col="1" text="bind:issueCode"/><Cell col="2" text="bind:issueMessage"/><Cell col="3" text="bind:severityCode"/></Band></Format></Formats>
</Grid> </Grid>
<Static id="staMessage0" taborder="900" left="36" top="824" width="1368" height="20" text="invalid 샘플로 오류 시나리오를 확인한 뒤 valid 샘플을 재업로드합니다."/>
<Layouts> <Layouts>
<Layout width="1440" height="900" screenid="Desktop_screen"/> <Layout width="1440" height="900" screenid="Desktop_screen"/>
</Layouts> </Layouts>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FDL version="2.1"> <FDL version="2.1">
<Form id="Form_Work" width="1200" height="844" titletext="Form_Work"> <Form id="Form_Work" width="1200" height="844" titletext="Form_Work">
<Div id="divWork" taborder="0" left="0" top="0" width="1200" height="844" url="Forms::frmLogin.xfdl"/> <Div id="divWork" taborder="0" left="0" top="0" width="1200" height="844" url="Base::frmLogin.xfdl"/>
<Layouts> <Layouts>
<Layout width="1200" height="844" screenid="Desktop_screen"/> <Layout width="1200" height="844" screenid="Desktop_screen"/>
</Layouts> </Layouts>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project version="2.1" nexacrosdk="Latest Version" sdkversion=""> <Project version="2.1" nexacrosdk="Latest Version" sdkversion="">
<EnvironmentDefinition url="/environment.xml"/> <EnvironmentDefinition url="environment.xml"/>
<TypeDefinition url="/typedefinition.xml"/> <TypeDefinition url="typedefinition.xml"/>
<AppVariables url="/appvariables.xml"/> <AppVariables url="appvariables.xml"/>
<AppInfos> <AppInfos>
<AppInfo url="/Application_Desktop.xadl"/> <AppInfo url="Application_Desktop.xadl"/>
</AppInfos> </AppInfos>
</Project> </Project>

View File

@ -1,15 +0,0 @@
this.gfnApiBase = function()
{
return application.g_apiBase || "/api";
};
this.gfnBuildTransactionUrl = function(path)
{
return this.gfnApiBase() + path;
};
this.gfnShowMessage = function(message)
{
trace(message);
};

View File

@ -41,8 +41,6 @@
<Component type="JavaScript" id="DateField" classname="nexacro.DateField"/> <Component type="JavaScript" id="DateField" classname="nexacro.DateField"/>
<Component type="JavaScript" id="DateRangePicker" classname="nexacro.DateRangePicker"/> <Component type="JavaScript" id="DateRangePicker" classname="nexacro.DateRangePicker"/>
<Component type="JavaScript" id="PopupDateRangePicker" classname="nexacro.PopupDateRangePicker"/> <Component type="JavaScript" id="PopupDateRangePicker" classname="nexacro.PopupDateRangePicker"/>
<Component type="JavaScript" id="View" classname="nexacro.View"/>
<Component type="JavaScript" id="FileUpload" classname="nexacro.FileUpload"/>
</Components> </Components>
<Services> <Services>
<Service prefixid="theme" type="resource" url="./_resource_/_theme_/" version="0" cachelevel="session" include_subdir="true"/> <Service prefixid="theme" type="resource" url="./_resource_/_theme_/" version="0" cachelevel="session" include_subdir="true"/>
@ -52,8 +50,8 @@
<Service prefixid="font" type="resource" url="./_resource_/_font_/" version="0" cachelevel="session" include_subdir="false"/> <Service prefixid="font" type="resource" url="./_resource_/_font_/" version="0" cachelevel="session" include_subdir="false"/>
<Service prefixid="stringrc" type="resource" url="./_resource_/_stringrc_/" version="0" cachelevel="session" include_subdir="false"/> <Service prefixid="stringrc" type="resource" url="./_resource_/_stringrc_/" version="0" cachelevel="session" include_subdir="false"/>
<Service prefixid="extlib" type="resource" url="./_extlib_/" version="0" cachelevel="session" include_subdir="true"/> <Service prefixid="extlib" type="resource" url="./_extlib_/" version="0" cachelevel="session" include_subdir="true"/>
<Service prefixid="Base" type="form" url="./Base/" version="0" cachelevel="session" include_subdir="false" communicationversion="0"/>
<Service prefixid="FrameBase" type="form" url="./FrameBase/" version="0" cachelevel="session" include_subdir="false" communicationversion="0"/> <Service prefixid="FrameBase" type="form" url="./FrameBase/" version="0" cachelevel="session" include_subdir="false" communicationversion="0"/>
<Service prefixid="Forms" type="form" url="./forms/" version="0" cachelevel="session" include_subdir="false" communicationversion="0"/>
</Services> </Services>
<Protocols/> <Protocols/>
<DeviceAdaptors/> <DeviceAdaptors/>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project version="2.1" nexacrosdk="Latest Version" sdkversion=""> <Project version="2.1" nexacrosdk="Latest Version" sdkversion="">
<EnvironmentDefinition url="/environment.xml"/> <EnvironmentDefinition url="environment.xml"/>
<TypeDefinition url="/typedefinition.xml"/> <TypeDefinition url="typedefinition.xml"/>
<AppVariables url="/appvariables.xml"/> <AppVariables url="appvariables.xml"/>
<AppInfos> <AppInfos>
<AppInfo url="/Application_Desktop.xadl"/> <AppInfo url="Application_Desktop.xadl"/>
</AppInfos> </AppInfos>
</Project> </Project>

View File

@ -41,8 +41,6 @@
<Component type="JavaScript" id="DateField" classname="nexacro.DateField"/> <Component type="JavaScript" id="DateField" classname="nexacro.DateField"/>
<Component type="JavaScript" id="DateRangePicker" classname="nexacro.DateRangePicker"/> <Component type="JavaScript" id="DateRangePicker" classname="nexacro.DateRangePicker"/>
<Component type="JavaScript" id="PopupDateRangePicker" classname="nexacro.PopupDateRangePicker"/> <Component type="JavaScript" id="PopupDateRangePicker" classname="nexacro.PopupDateRangePicker"/>
<Component type="JavaScript" id="View" classname="nexacro.View"/>
<Component type="JavaScript" id="FileUpload" classname="nexacro.FileUpload"/>
</Components> </Components>
<Services> <Services>
<Service prefixid="theme" type="resource" url="./_resource_/_theme_/" version="0" cachelevel="session" include_subdir="true"/> <Service prefixid="theme" type="resource" url="./_resource_/_theme_/" version="0" cachelevel="session" include_subdir="true"/>
@ -52,8 +50,8 @@
<Service prefixid="font" type="resource" url="./_resource_/_font_/" version="0" cachelevel="session" include_subdir="false"/> <Service prefixid="font" type="resource" url="./_resource_/_font_/" version="0" cachelevel="session" include_subdir="false"/>
<Service prefixid="stringrc" type="resource" url="./_resource_/_stringrc_/" version="0" cachelevel="session" include_subdir="false"/> <Service prefixid="stringrc" type="resource" url="./_resource_/_stringrc_/" version="0" cachelevel="session" include_subdir="false"/>
<Service prefixid="extlib" type="resource" url="./_extlib_/" version="0" cachelevel="session" include_subdir="true"/> <Service prefixid="extlib" type="resource" url="./_extlib_/" version="0" cachelevel="session" include_subdir="true"/>
<Service prefixid="Base" type="form" url="./Base/" version="0" cachelevel="session" include_subdir="false" communicationversion="0"/>
<Service prefixid="FrameBase" type="form" url="./FrameBase/" version="0" cachelevel="session" include_subdir="false" communicationversion="0"/> <Service prefixid="FrameBase" type="form" url="./FrameBase/" version="0" cachelevel="session" include_subdir="false" communicationversion="0"/>
<Service prefixid="Forms" type="form" url="./forms/" version="0" cachelevel="session" include_subdir="false" communicationversion="0"/>
</Services> </Services>
<Protocols/> <Protocols/>
<DeviceAdaptors/> <DeviceAdaptors/>

View File

@ -10,9 +10,8 @@ const previewDir = path.join(repoRoot, "client", "nexacro-deploy");
const UTF8_BOM = "\uFEFF"; const UTF8_BOM = "\uFEFF";
const FRAME_TOP_HEIGHT = 56; const FRAME_TOP_HEIGHT = 56;
const FRAME_LEFT_WIDTH = 240; const FRAME_LEFT_WIDTH = 240;
const FORMS_DIR = "forms"; const BASE_DIR = "Base";
const FRAMEBASE_DIR = "FrameBase"; const FRAMEBASE_DIR = "FrameBase";
const LIB_DIR = "lib";
function readYaml(filePath) { function readYaml(filePath) {
return yaml.load(fs.readFileSync(filePath, "utf8")); return yaml.load(fs.readFileSync(filePath, "utf8"));
@ -62,7 +61,7 @@ function cleanGeneratedOutput(baseOutputDir, projectName) {
".DS_Store" ".DS_Store"
].forEach((file) => removePathIfExists(path.join(baseOutputDir, file))); ].forEach((file) => removePathIfExists(path.join(baseOutputDir, file)));
["forms", FORMS_DIR, "frame", FRAMEBASE_DIR, "lib", LIB_DIR].forEach((dir) => ["forms", BASE_DIR, "frame", FRAMEBASE_DIR, "lib"].forEach((dir) =>
removePathIfExists(path.join(baseOutputDir, dir)) removePathIfExists(path.join(baseOutputDir, dir))
); );
} }
@ -104,6 +103,7 @@ function toXfdlDataset(dataset) {
} }
function componentTag(component, index = 0) { function componentTag(component, index = 0) {
const componentType = component.type === "FileUpload" ? "Edit" : component.type;
const attrs = [ const attrs = [
`id="${component.id}"`, `id="${component.id}"`,
`taborder="${index}"`, `taborder="${index}"`,
@ -116,22 +116,21 @@ function componentTag(component, index = 0) {
if (component.text) { if (component.text) {
attrs.push(`text="${escapeXml(component.text)}"`); attrs.push(`text="${escapeXml(component.text)}"`);
} }
if (component.prompt && ["Edit", "MaskEdit", "TextArea"].includes(component.type)) { if (component.prompt && ["Edit", "MaskEdit", "TextArea"].includes(componentType)) {
attrs.push(`displaynulltext="${escapeXml(component.prompt)}"`); attrs.push(`displaynulltext="${escapeXml(component.prompt)}"`);
} }
if (component.bind && ["Edit", "MaskEdit", "TextArea"].includes(component.type)) { if (componentType === "Edit" && component.id.toLowerCase().includes("password")) {
const [, columnId] = component.bind.split(".");
attrs.push(`value="bind:${columnId}"`);
}
if (component.type === "Edit" && component.id.toLowerCase().includes("password")) {
attrs.push('password="true"'); attrs.push('password="true"');
} }
if (component.type === "Combo") { if (componentType === "Combo") {
attrs.push('codecolumn="code"'); attrs.push('codecolumn="code"');
attrs.push('datacolumn="label"'); attrs.push('datacolumn="label"');
} }
if (component.type === "FileUpload") {
attrs.push('readonly="true"');
}
return ` <${component.type} ${attrs.join(" ")}/>`; return ` <${componentType} ${attrs.join(" ")}/>`;
} }
function gridFormats(grid) { function gridFormats(grid) {
@ -185,11 +184,21 @@ function buildFormScript(form) {
.trim(); .trim();
} }
function renderMessageStatics(form, layout) {
return (form.messages || [])
.map(
(message, index) =>
` <Static id="staMessage${index}" taborder="${900 + index}" left="36" top="${Math.max(layout.height - 76 + index * 22, 36)}" width="${Math.max(layout.width - 72, 300)}" height="20" text="${escapeXml(message.text)}"/>`
)
.join("\n");
}
function renderXfdl(form, appSpec) { function renderXfdl(form, appSpec) {
const datasets = (form.datasets || []).map(toXfdlDataset).join("\n"); const datasets = (form.datasets || []).map(toXfdlDataset).join("\n");
const components = (form.components || []).map((component, index) => componentTag(component, index)).join("\n"); const components = (form.components || []).map((component, index) => componentTag(component, index)).join("\n");
const grids = (form.grids || []).map(gridTag).join("\n"); const grids = (form.grids || []).map(gridTag).join("\n");
const layout = form.layout || appSpec.layout; const layout = form.layout || appSpec.layout;
const messages = renderMessageStatics(form, layout);
return [ return [
'<?xml version="1.0" encoding="utf-8"?>', '<?xml version="1.0" encoding="utf-8"?>',
@ -205,6 +214,7 @@ function renderXfdl(form, appSpec) {
" ]]></Script>", " ]]></Script>",
components, components,
grids, grids,
messages,
" <Layouts>", " <Layouts>",
` <Layout width="${layout.width}" height="${layout.height}" screenid="Desktop_screen"/>`, ` <Layout width="${layout.width}" height="${layout.height}" screenid="Desktop_screen"/>`,
" </Layouts>", " </Layouts>",
@ -261,7 +271,7 @@ function renderWorkFrame(appSpec, defaultFormId) {
'<?xml version="1.0" encoding="utf-8"?>', '<?xml version="1.0" encoding="utf-8"?>',
'<FDL version="2.1">', '<FDL version="2.1">',
` <Form id="Form_Work" width="${workWidth}" height="${workHeight}" titletext="Form_Work">`, ` <Form id="Form_Work" width="${workWidth}" height="${workHeight}" titletext="Form_Work">`,
` <Div id="divWork" taborder="0" left="0" top="0" width="${workWidth}" height="${workHeight}" url="Forms::${defaultFormId}.xfdl"/>`, ` <Div id="divWork" taborder="0" left="0" top="0" width="${workWidth}" height="${workHeight}" url="Base::${defaultFormId}.xfdl"/>`,
" <Layouts>", " <Layouts>",
` <Layout width="${workWidth}" height="${workHeight}" screenid="Desktop_screen"/>`, ` <Layout width="${workWidth}" height="${workHeight}" screenid="Desktop_screen"/>`,
" </Layouts>", " </Layouts>",
@ -274,9 +284,9 @@ function renderWorkFrame(appSpec, defaultFormId) {
function generateProjectFiles(appSpec, forms, baseOutputDir = outputDir) { function generateProjectFiles(appSpec, forms, baseOutputDir = outputDir) {
cleanGeneratedOutput(baseOutputDir, appSpec.projectName); cleanGeneratedOutput(baseOutputDir, appSpec.projectName);
ensureDir(baseOutputDir); ensureDir(baseOutputDir);
ensureDir(path.join(baseOutputDir, FORMS_DIR)); ensureDir(path.join(baseOutputDir, BASE_DIR));
ensureDir(path.join(baseOutputDir, FRAMEBASE_DIR)); ensureDir(path.join(baseOutputDir, FRAMEBASE_DIR));
ensureDir(path.join(baseOutputDir, LIB_DIR)); ensureDir(path.join(baseOutputDir, "_extlib_"));
writeGeneratedFile( writeGeneratedFile(
path.join(baseOutputDir, `${appSpec.projectName}.xprj`), path.join(baseOutputDir, `${appSpec.projectName}.xprj`),
@ -302,9 +312,6 @@ function generateProjectFiles(appSpec, forms, baseOutputDir = outputDir) {
); );
writeGeneratedFile(path.join(baseOutputDir, "typedefinition.xml"), readTemplate("typedefinition.xml.tpl")); writeGeneratedFile(path.join(baseOutputDir, "typedefinition.xml"), readTemplate("typedefinition.xml.tpl"));
writeGeneratedFile(path.join(baseOutputDir, "appvariables.xml"), readTemplate("appvariables.xml.tpl"), { bom: false }); writeGeneratedFile(path.join(baseOutputDir, "appvariables.xml"), readTemplate("appvariables.xml.tpl"), { bom: false });
writeGeneratedFile(path.join(baseOutputDir, LIB_DIR, "common.xjs"), readTemplate(path.join("common", "common.xjs.tpl")), {
bom: false
});
writeGeneratedFile(path.join(baseOutputDir, FRAMEBASE_DIR, "Form_Top.xfdl"), renderTopFrame(appSpec)); writeGeneratedFile(path.join(baseOutputDir, FRAMEBASE_DIR, "Form_Top.xfdl"), renderTopFrame(appSpec));
writeGeneratedFile(path.join(baseOutputDir, FRAMEBASE_DIR, "Form_Left.xfdl"), renderLeftFrame(forms)); writeGeneratedFile(path.join(baseOutputDir, FRAMEBASE_DIR, "Form_Left.xfdl"), renderLeftFrame(forms));
const defaultForm = forms.find((form) => form.route === "login") || forms[0]; const defaultForm = forms.find((form) => form.route === "login") || forms[0];
@ -314,7 +321,7 @@ function generateProjectFiles(appSpec, forms, baseOutputDir = outputDir) {
); );
forms.forEach((form) => { forms.forEach((form) => {
writeGeneratedFile(path.join(baseOutputDir, FORMS_DIR, `${form.formId}.xfdl`), renderXfdl(form, appSpec)); writeGeneratedFile(path.join(baseOutputDir, BASE_DIR, `${form.formId}.xfdl`), renderXfdl(form, appSpec));
}); });
} }

View File

@ -23,7 +23,7 @@ test("project generator writes required Nexacro files", () => {
assert.ok(fs.existsSync(path.join(tempDir, "environment.xml"))); assert.ok(fs.existsSync(path.join(tempDir, "environment.xml")));
assert.ok(fs.existsSync(path.join(tempDir, "typedefinition.xml"))); assert.ok(fs.existsSync(path.join(tempDir, "typedefinition.xml")));
assert.ok(fs.existsSync(path.join(tempDir, "appvariables.xml"))); assert.ok(fs.existsSync(path.join(tempDir, "appvariables.xml")));
assert.ok(fs.existsSync(path.join(tempDir, "forms", "frmLogin.xfdl"))); assert.ok(fs.existsSync(path.join(tempDir, "Base", "frmLogin.xfdl")));
assert.ok(fs.existsSync(path.join(tempDir, "FrameBase", "Form_Work.xfdl"))); assert.ok(fs.existsSync(path.join(tempDir, "FrameBase", "Form_Work.xfdl")));
assert.ok(fs.readFileSync(path.join(tempDir, "HanwhaNexacroDemo.xprj"), "utf8").includes("Application_Desktop.xadl")); assert.ok(fs.readFileSync(path.join(tempDir, "HanwhaNexacroDemo.xprj"), "utf8").includes("Application_Desktop.xadl"));