2020-05-28 22:35:45 +02:00
|
|
|
// ***************************************************************************
|
|
|
|
//
|
|
|
|
// Delphi MVC Framework
|
|
|
|
//
|
2024-01-02 17:04:27 +01:00
|
|
|
// Copyright (c) 2010-2024 Daniele Teti and the DMVCFramework Team
|
2020-05-28 22:35:45 +02:00
|
|
|
//
|
|
|
|
// https://github.com/danieleteti/delphimvcframework
|
|
|
|
//
|
|
|
|
// ***************************************************************************
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
// ***************************************************************************
|
|
|
|
//
|
|
|
|
// This IDE expert is based off of the one included with the DUnitX }
|
2024-04-12 12:28:34 +02:00
|
|
|
// project. Original source by Robert Love. Adapted by Nick Hodges and Daniele Teti. }
|
2020-05-28 22:35:45 +02:00
|
|
|
//
|
|
|
|
// The DUnitX project is run by Vincent Parrett and can be found at: }
|
|
|
|
//
|
|
|
|
// https://github.com/VSoftTechnologies/DUnitX }
|
|
|
|
// ***************************************************************************
|
|
|
|
|
2016-02-23 01:41:13 +01:00
|
|
|
unit DMVC.Expert.Forms.NewProjectWizard;
|
|
|
|
|
2024-10-14 09:21:56 +02:00
|
|
|
{$I dmvcframework.inc}
|
|
|
|
|
2016-02-23 01:41:13 +01:00
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
WinAPI.Windows,
|
|
|
|
WinAPI.Messages,
|
2016-11-24 20:07:45 +01:00
|
|
|
WinAPI.ShellAPI,
|
2016-02-23 01:41:13 +01:00
|
|
|
System.SysUtils,
|
|
|
|
System.Variants,
|
|
|
|
System.Classes,
|
|
|
|
VCL.Graphics,
|
|
|
|
VCL.Controls,
|
|
|
|
VCL.Forms,
|
|
|
|
VCL.Dialogs,
|
2016-11-24 20:07:45 +01:00
|
|
|
VCL.StdCtrls,
|
2023-01-17 09:03:19 +01:00
|
|
|
VCL.Imaging.pngimage,
|
|
|
|
VCL.ExtCtrls,
|
|
|
|
System.Actions,
|
|
|
|
Vcl.ActnList,
|
2024-06-09 23:53:25 +02:00
|
|
|
Vcl.AppEvnts,
|
|
|
|
JsonDataObjects;
|
2016-02-23 01:41:13 +01:00
|
|
|
|
|
|
|
type
|
|
|
|
TfrmDMVCNewProject = class(TForm)
|
|
|
|
btnOK: TButton;
|
|
|
|
btnCancel: TButton;
|
|
|
|
chkAddToProjectGroup: TCheckBox;
|
|
|
|
edtWebModuleName: TEdit;
|
|
|
|
lblWbModule: TLabel;
|
2016-02-24 22:37:13 +01:00
|
|
|
edtServerPort: TEdit;
|
|
|
|
Label2: TLabel;
|
2016-11-24 20:07:45 +01:00
|
|
|
Image1: TImage;
|
2017-05-09 10:49:28 +02:00
|
|
|
lblFrameworkVersion: TLabel;
|
2022-07-25 10:36:30 +02:00
|
|
|
Panel2: TPanel;
|
|
|
|
gbControllerUnitOptions: TGroupBox;
|
|
|
|
lblClassName: TLabel;
|
|
|
|
Label1: TLabel;
|
|
|
|
chkCreateIndexMethod: TCheckBox;
|
2024-04-12 12:28:34 +02:00
|
|
|
edtControllerClassName: TEdit;
|
2022-07-25 10:36:30 +02:00
|
|
|
chkCreateActionFiltersMethods: TCheckBox;
|
|
|
|
chkCreateCRUDMethods: TCheckBox;
|
|
|
|
Shape1: TShape;
|
2022-08-13 00:21:00 +02:00
|
|
|
GroupBox1: TGroupBox;
|
|
|
|
chkAnalyticsMiddleware: TCheckBox;
|
|
|
|
chkCompression: TCheckBox;
|
|
|
|
chkStaticFiles: TCheckBox;
|
|
|
|
chkTrace: TCheckBox;
|
|
|
|
chkCORS: TCheckBox;
|
2022-08-13 10:35:53 +02:00
|
|
|
chkETAG: TCheckBox;
|
|
|
|
lblBook: TLabel;
|
2022-08-13 16:10:19 +02:00
|
|
|
chkActiveRecord: TCheckBox;
|
|
|
|
EdtFDConnDefFileName: TEdit;
|
|
|
|
GroupBoxJSONRPC: TGroupBox;
|
|
|
|
Label3: TLabel;
|
|
|
|
EdtJSONRPCClassName: TEdit;
|
|
|
|
chkJSONRPC: TCheckBox;
|
|
|
|
Label4: TLabel;
|
|
|
|
Bevel1: TBevel;
|
|
|
|
Label5: TLabel;
|
|
|
|
EdtConnDefName: TEdit;
|
|
|
|
ApplicationEvents: TApplicationEvents;
|
2023-01-17 09:03:19 +01:00
|
|
|
lblCopyRight: TLabel;
|
2023-10-23 11:05:07 +02:00
|
|
|
chkMSHeap: TCheckBox;
|
2024-04-19 15:58:19 +02:00
|
|
|
chkCustomConfigDotEnv: TCheckBox;
|
2024-04-19 18:19:08 +02:00
|
|
|
chkProfileActions: TCheckBox;
|
|
|
|
lblPATREON: TLabel;
|
2024-04-29 17:49:54 +02:00
|
|
|
chkServicesContainer: TCheckBox;
|
2024-05-10 16:16:47 +02:00
|
|
|
chkSqids: TCheckBox;
|
2024-06-09 23:53:25 +02:00
|
|
|
rgNameCase: TRadioGroup;
|
2024-10-14 09:21:56 +02:00
|
|
|
rgSSV: TRadioGroup;
|
2016-02-23 01:41:13 +01:00
|
|
|
procedure FormCreate(Sender: TObject);
|
2016-11-24 20:07:45 +01:00
|
|
|
procedure Image1Click(Sender: TObject);
|
2020-08-22 15:37:08 +02:00
|
|
|
procedure lblBookMouseEnter(Sender: TObject);
|
|
|
|
procedure lblBookMouseLeave(Sender: TObject);
|
|
|
|
procedure lblBookClick(Sender: TObject);
|
2022-07-25 10:36:30 +02:00
|
|
|
procedure lblFrameworkVersionMouseEnter(Sender: TObject);
|
|
|
|
procedure lblFrameworkVersionMouseLeave(Sender: TObject);
|
|
|
|
procedure lblFrameworkVersionClick(Sender: TObject);
|
2022-08-13 16:10:19 +02:00
|
|
|
procedure ApplicationEventsIdle(Sender: TObject; var Done: Boolean);
|
|
|
|
procedure btnOKClick(Sender: TObject);
|
2024-04-12 12:28:34 +02:00
|
|
|
procedure FormDestroy(Sender: TObject);
|
2024-04-19 18:19:08 +02:00
|
|
|
procedure lblPATREONClick(Sender: TObject);
|
|
|
|
procedure lblPATREONMouseEnter(Sender: TObject);
|
|
|
|
procedure lblPATREONMouseLeave(Sender: TObject);
|
2024-10-14 09:21:56 +02:00
|
|
|
procedure rgSSVClick(Sender: TObject);
|
2016-02-23 01:41:13 +01:00
|
|
|
private
|
|
|
|
{ Private declarations }
|
2024-04-12 12:28:34 +02:00
|
|
|
fModel: TJsonObject;
|
2016-02-23 01:41:13 +01:00
|
|
|
function GetAddToProjectGroup: boolean;
|
|
|
|
function GetCreateIndexMethod: boolean;
|
|
|
|
function GetCreateControllerUnit: boolean;
|
|
|
|
function GetControllerClassName: string;
|
|
|
|
function GetWebModuleClassName: string;
|
2016-02-24 22:37:13 +01:00
|
|
|
function GetCreateActionFiltersMethods: boolean;
|
|
|
|
function GetServerPort: Integer;
|
2017-05-17 22:32:45 +02:00
|
|
|
function GetCreateCRUDMethods: boolean;
|
2022-07-25 10:36:30 +02:00
|
|
|
function GetCreateJSONRPCInterface: boolean;
|
|
|
|
function GetJSONRPCClassName: String;
|
2016-02-23 01:41:13 +01:00
|
|
|
public
|
|
|
|
{ Public declarations }
|
|
|
|
// Read Only Properties to extract values without having to know control values.
|
|
|
|
property ControllerClassName: string read GetControllerClassName;
|
2016-02-24 22:37:13 +01:00
|
|
|
property CreateControllerUnit: boolean read GetCreateControllerUnit;
|
2022-07-25 10:36:30 +02:00
|
|
|
property JSONRPCClassName: String read GetJSONRPCClassName;
|
2016-02-24 22:37:13 +01:00
|
|
|
property AddToProjectGroup: boolean read GetAddToProjectGroup;
|
|
|
|
property CreateIndexMethod: boolean read GetCreateIndexMethod;
|
2017-05-17 22:32:45 +02:00
|
|
|
property CreateCRUDMethods: boolean read GetCreateCRUDMethods;
|
2016-02-24 22:37:13 +01:00
|
|
|
property CreateActionFiltersMethods: boolean
|
|
|
|
read GetCreateActionFiltersMethods;
|
2016-02-23 01:41:13 +01:00
|
|
|
property WebModuleClassName: string read GetWebModuleClassName;
|
2024-04-12 12:28:34 +02:00
|
|
|
function GetConfigModel: TJSONObject;
|
2016-02-23 01:41:13 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
uses
|
2023-01-17 09:03:19 +01:00
|
|
|
MVCFramework.Commons,
|
2024-06-09 23:53:25 +02:00
|
|
|
MVCFramework.Serializer.Commons,
|
2024-04-12 12:28:34 +02:00
|
|
|
System.StrUtils,
|
2024-06-09 23:53:25 +02:00
|
|
|
DMVC.Expert.Commons, System.TypInfo;
|
2016-02-23 01:41:13 +01:00
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
2022-08-13 16:10:19 +02:00
|
|
|
procedure TfrmDMVCNewProject.ApplicationEventsIdle(Sender: TObject;
|
|
|
|
var Done: Boolean);
|
|
|
|
begin
|
|
|
|
EdtFDConnDefFileName.Enabled := chkActiveRecord.Checked;
|
|
|
|
EdtConnDefName.Enabled := chkActiveRecord.Checked;
|
|
|
|
EdtJSONRPCClassName.Enabled := chkJSONRPC.Checked;
|
2024-04-19 18:19:08 +02:00
|
|
|
chkProfileActions.Enabled := chkCreateIndexMethod.Checked or chkCreateCRUDMethods.Checked;
|
|
|
|
if not chkProfileActions.Enabled then
|
|
|
|
begin
|
|
|
|
chkProfileActions.Checked := False;
|
|
|
|
end;
|
2022-08-13 16:10:19 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmDMVCNewProject.btnOKClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if chkActiveRecord.Checked then
|
|
|
|
begin
|
|
|
|
ShowMessage('Remember to include required FireDAC units in your project');
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2016-02-23 01:41:13 +01:00
|
|
|
procedure TfrmDMVCNewProject.FormCreate(Sender: TObject);
|
|
|
|
begin
|
2024-04-16 00:22:41 +02:00
|
|
|
edtControllerClassName.TextHint := TDefaultValues.sDefaultControllerName;
|
|
|
|
edtWebModuleName.TextHint := TDefaultValues.sDefaultWebModuleName;
|
|
|
|
edtServerPort.TextHint := TDefaultValues.sDefaultServerPort;
|
2022-08-13 16:10:19 +02:00
|
|
|
lblFrameworkVersion.Caption := 'dmvcframework-' + DMVCFRAMEWORK_VERSION;
|
2022-07-25 10:36:30 +02:00
|
|
|
chkJSONRPC.Checked := False;
|
2023-01-17 09:03:19 +01:00
|
|
|
lblCopyRight.Caption := TMVCConstants.COPYRIGHT;
|
2024-04-12 12:28:34 +02:00
|
|
|
fModel := TJsonObject.Create;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmDMVCNewProject.FormDestroy(Sender: TObject);
|
|
|
|
begin
|
|
|
|
fModel.Free;
|
2016-02-23 01:41:13 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
function TfrmDMVCNewProject.GetAddToProjectGroup: boolean;
|
|
|
|
begin
|
|
|
|
Result := chkAddToProjectGroup.Checked;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function TfrmDMVCNewProject.GetCreateIndexMethod: boolean;
|
|
|
|
begin
|
|
|
|
Result := chkCreateIndexMethod.Checked;
|
|
|
|
end;
|
|
|
|
|
2022-07-25 10:36:30 +02:00
|
|
|
function TfrmDMVCNewProject.GetCreateJSONRPCInterface: boolean;
|
|
|
|
begin
|
|
|
|
Result := chkJSONRPC.Checked;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function TfrmDMVCNewProject.GetJSONRPCClassName: String;
|
|
|
|
begin
|
|
|
|
if GetCreateJSONRPCInterface then
|
|
|
|
begin
|
|
|
|
Result := EdtJSONRPCClassName.Text;
|
|
|
|
if Result.IsEmpty then
|
|
|
|
begin
|
|
|
|
Result := EdtJSONRPCClassName.TextHint;
|
|
|
|
end;
|
|
|
|
end
|
|
|
|
else
|
|
|
|
begin
|
|
|
|
Result := '';
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2016-02-24 22:37:13 +01:00
|
|
|
function TfrmDMVCNewProject.GetServerPort: Integer;
|
|
|
|
var
|
|
|
|
lServerPort: Integer;
|
|
|
|
begin
|
2024-04-16 00:22:41 +02:00
|
|
|
Result := StrToInt(TDefaultValues.sDefaultServerPort);
|
2016-02-24 22:37:13 +01:00
|
|
|
if (Trim(edtServerPort.Text) <> '') and TryStrToInt(edtServerPort.Text,
|
|
|
|
lServerPort) then
|
|
|
|
begin
|
|
|
|
if (lServerPort > 0) and (lServerPort < 65535) then
|
|
|
|
Result := lServerPort;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2016-02-23 01:41:13 +01:00
|
|
|
function TfrmDMVCNewProject.GetWebModuleClassName: string;
|
|
|
|
begin
|
|
|
|
if Trim(edtWebModuleName.Text) = '' then
|
|
|
|
begin
|
2024-04-16 00:22:41 +02:00
|
|
|
Result := TDefaultValues.sDefaultWebModuleName
|
2016-02-24 22:37:13 +01:00
|
|
|
end
|
|
|
|
else
|
2016-02-23 01:41:13 +01:00
|
|
|
begin
|
|
|
|
Result := Trim(edtWebModuleName.Text);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2016-11-24 20:07:45 +01:00
|
|
|
procedure TfrmDMVCNewProject.Image1Click(Sender: TObject);
|
|
|
|
begin
|
|
|
|
ShellExecute(0, PChar('open'),
|
2020-08-22 15:37:08 +02:00
|
|
|
PChar('https://github.com/danieleteti/delphimvcframework'),
|
2016-11-24 20:07:45 +01:00
|
|
|
nil, nil, SW_SHOW);
|
|
|
|
end;
|
|
|
|
|
2024-04-19 18:19:08 +02:00
|
|
|
procedure TfrmDMVCNewProject.lblPATREONClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
ShellExecute(0, PChar('open'),
|
|
|
|
PChar('https://www.patreon.com/delphimvcframework'),
|
|
|
|
nil, nil, SW_SHOW);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmDMVCNewProject.lblPATREONMouseEnter(Sender: TObject);
|
|
|
|
begin
|
|
|
|
lblPATREON.Font.Color := clHighlight;
|
|
|
|
lblPATREON.Font.Style := lblPATREON.Font.Style + [fsUnderline];
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmDMVCNewProject.lblPATREONMouseLeave(Sender: TObject);
|
|
|
|
begin
|
|
|
|
lblPATREON.Font.Color := Font.Color;
|
|
|
|
lblPATREON.Font.Style := lblPATREON.Font.Style - [fsUnderline];
|
|
|
|
end;
|
|
|
|
|
2024-10-14 09:21:56 +02:00
|
|
|
procedure TfrmDMVCNewProject.rgSSVClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
{$if not Defined(WEBSTENCILS)}
|
|
|
|
if SameText(rgSSV.Items[rgSSV.ItemIndex], 'webstencils') then
|
|
|
|
begin
|
|
|
|
ShowMessage('This Delphi version doesn''t support WebStencils, so DMVCFramework cannot use it.' +
|
|
|
|
sLineBreak + 'Consider to use TemplatePro.');
|
|
|
|
rgSSV.ItemIndex := 1;
|
|
|
|
end;
|
|
|
|
{$endif}
|
|
|
|
end;
|
|
|
|
|
2020-08-22 15:37:08 +02:00
|
|
|
procedure TfrmDMVCNewProject.lblBookClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
ShellExecute(0, PChar('open'),
|
|
|
|
PChar('https://leanpub.com/delphimvcframework'),
|
|
|
|
nil, nil, SW_SHOW);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmDMVCNewProject.lblBookMouseEnter(Sender: TObject);
|
|
|
|
begin
|
|
|
|
lblBook.Font.Color := clHighlight;
|
|
|
|
lblBook.Font.Style := lblBook.Font.Style + [fsUnderline];
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmDMVCNewProject.lblBookMouseLeave(Sender: TObject);
|
|
|
|
begin
|
|
|
|
lblBook.Font.Color := Font.Color;
|
|
|
|
lblBook.Font.Style := lblBook.Font.Style - [fsUnderline];
|
|
|
|
end;
|
|
|
|
|
2022-07-25 10:36:30 +02:00
|
|
|
procedure TfrmDMVCNewProject.lblFrameworkVersionClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
ShellExecute(0, PChar('open'),
|
|
|
|
PChar('https://github.com/danieleteti/delphimvcframework/releases/latest'),
|
|
|
|
nil, nil, SW_SHOW);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmDMVCNewProject.lblFrameworkVersionMouseEnter(Sender: TObject);
|
|
|
|
begin
|
|
|
|
lblFrameworkVersion.Font.Color := clHighlight;
|
|
|
|
lblFrameworkVersion.Font.Style := lblFrameworkVersion.Font.Style + [fsUnderline];
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmDMVCNewProject.lblFrameworkVersionMouseLeave(Sender: TObject);
|
|
|
|
begin
|
|
|
|
lblFrameworkVersion.Font.Color := Font.Color;
|
|
|
|
lblFrameworkVersion.Font.Style := lblFrameworkVersion.Font.Style - [fsUnderline];
|
|
|
|
end;
|
|
|
|
|
2016-02-24 22:37:13 +01:00
|
|
|
function TfrmDMVCNewProject.GetCreateActionFiltersMethods: boolean;
|
|
|
|
begin
|
|
|
|
Result := chkCreateActionFiltersMethods.Checked;
|
|
|
|
end;
|
|
|
|
|
2016-02-23 01:41:13 +01:00
|
|
|
function TfrmDMVCNewProject.GetCreateControllerUnit: boolean;
|
|
|
|
begin
|
2024-08-24 16:32:38 +02:00
|
|
|
Result := True;
|
2016-02-23 01:41:13 +01:00
|
|
|
end;
|
|
|
|
|
2017-05-17 22:32:45 +02:00
|
|
|
function TfrmDMVCNewProject.GetCreateCRUDMethods: boolean;
|
|
|
|
begin
|
|
|
|
Result := chkCreateCRUDMethods.Checked;
|
|
|
|
end;
|
|
|
|
|
2024-04-12 12:28:34 +02:00
|
|
|
function TfrmDMVCNewProject.GetConfigModel: TJSONObject;
|
|
|
|
begin
|
|
|
|
fModel.Clear;
|
|
|
|
fModel.S[TConfigKey.program_name] := 'TBA';
|
2024-04-16 11:09:02 +02:00
|
|
|
fModel.S[TConfigKey.program_default_server_port] := GetServerPort.ToString;
|
2024-04-12 12:28:34 +02:00
|
|
|
fModel.B[TConfigKey.program_msheap] := chkMSHeap.Checked;
|
2024-05-10 16:16:47 +02:00
|
|
|
fModel.B[TConfigKey.program_sqids] := chkSqids.Checked;
|
2024-04-19 15:58:19 +02:00
|
|
|
fModel.B[TConfigKey.program_dotenv] := chkCustomConfigDotEnv.Checked;
|
2024-10-14 09:21:56 +02:00
|
|
|
fModel.B[TConfigKey.program_ssv_templatepro] := SameText(rgSSV.Items[rgSSV.ItemIndex], 'templatepro');
|
|
|
|
fModel.B[TConfigKey.program_ssv_webstencils] := SameText(rgSSV.Items[rgSSV.ItemIndex], 'webstencils');
|
|
|
|
fModel.B[TConfigKey.program_ssv_mustache] := SameText(rgSSV.Items[rgSSV.ItemIndex], 'mustache');
|
2024-04-29 17:49:54 +02:00
|
|
|
fModel.B[TConfigKey.program_service_container_generate] := chkServicesContainer.Checked;
|
|
|
|
fModel.S[TConfigKey.program_service_container_unit_name] := 'TBA';
|
2024-04-12 12:28:34 +02:00
|
|
|
fModel.S[TConfigKey.controller_unit_name] := 'TBA';
|
|
|
|
fModel.S[TConfigKey.controller_classname] := GetControllerClassName;
|
|
|
|
fModel.B[TConfigKey.controller_index_methods_generate] := chkCreateIndexMethod.Checked;
|
|
|
|
fModel.B[TConfigKey.controller_action_filters_generate] := chkCreateActionFiltersMethods.Checked;
|
|
|
|
fModel.B[TConfigKey.controller_crud_methods_generate] := chkCreateCRUDMethods.Checked;
|
2024-04-19 18:19:08 +02:00
|
|
|
fModel.B[TConfigKey.controller_actions_profiling_generate] := chkProfileActions.Checked;
|
2024-04-12 12:28:34 +02:00
|
|
|
fModel.B[TConfigKey.entity_generate] := fModel.B[TConfigKey.controller_crud_methods_generate];
|
|
|
|
fModel.S[TConfigKey.entity_classname] := 'TPerson';
|
|
|
|
fModel.B[TConfigKey.jsonrpc_generate] := GetCreateJSONRPCInterface;
|
2024-04-29 17:49:54 +02:00
|
|
|
fModel.S[TConfigKey.jsonrpc_classname] := GetJSONRPCClassName;
|
|
|
|
fModel.S[TConfigKey.jsonrpc_unit_name] := 'TBA';
|
2024-06-09 23:53:25 +02:00
|
|
|
fModel.S[TConfigKey.serializer_name_case] := GetEnumName(TypeInfo(TMVCNameCase), rgNameCase.ItemIndex + 1);
|
2024-04-12 12:28:34 +02:00
|
|
|
//webmodule
|
|
|
|
|
|
|
|
fModel.S[TConfigKey.webmodule_classname] := GetWebModuleClassName;
|
|
|
|
fModel.B[TConfigKey.webmodule_middleware_analytics] := chkAnalyticsMiddleware.Checked;
|
|
|
|
fModel.B[TConfigKey.webmodule_middleware_staticfiles] := chkStaticFiles.Checked;
|
|
|
|
fModel.B[TConfigKey.webmodule_middleware_trace] := chkTrace.Checked;
|
|
|
|
fModel.B[TConfigKey.webmodule_middleware_compression] := chkCompression.Checked;
|
|
|
|
fModel.B[TConfigKey.webmodule_middleware_etag] := chkETAG.Checked;
|
|
|
|
fModel.B[TConfigKey.webmodule_middleware_cors] := chkCORS.Checked;
|
|
|
|
fModel.B[TConfigKey.webmodule_middleware_activerecord] := chkActiveRecord.Checked;
|
|
|
|
fModel.S[TConfigKey.webmodule_middleware_activerecord_con_def_name] := EdtConnDefName.Text;
|
|
|
|
fModel.S[TConfigKey.webmodule_middleware_activerecord_con_def_filename] := EdtFDConnDefFileName.Text;
|
|
|
|
|
|
|
|
//webmodule - end
|
|
|
|
Result := fModel;
|
|
|
|
end;
|
|
|
|
|
2016-02-23 01:41:13 +01:00
|
|
|
function TfrmDMVCNewProject.GetControllerClassName: string;
|
|
|
|
begin
|
2024-04-12 12:28:34 +02:00
|
|
|
if Trim(edtControllerClassName.Text) = '' then
|
2016-02-23 01:41:13 +01:00
|
|
|
begin
|
2024-04-16 00:22:41 +02:00
|
|
|
Result := TDefaultValues.sDefaultControllerName
|
2016-02-24 22:37:13 +01:00
|
|
|
end
|
|
|
|
else
|
2016-02-23 01:41:13 +01:00
|
|
|
begin
|
2024-04-12 12:28:34 +02:00
|
|
|
Result := Trim(edtControllerClassName.Text);
|
2016-02-23 01:41:13 +01:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|