Skip to content

Commit

Permalink
Samples cleanup for 3.4.2-magnesium
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Feb 14, 2025
1 parent dbe4379 commit d8987ab
Show file tree
Hide file tree
Showing 112 changed files with 65 additions and 13,377 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DelphiMVCFramework ![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg) ![GitHub All Releases](https://img.shields.io/github/downloads/danieleteti/delphimvcframework/total?label=Downloads)

![](https://img.shields.io/badge/stable-dmvcframework--3.4.1--sodium-blue)
![](https://img.shields.io/badge/beta-dmvcframework--3.4.2--magnesium--rc4-red)
![](https://img.shields.io/badge/stable-dmvcframework--3.4.2--magnesium-blue)
![](https://img.shields.io/badge/beta-dmvcframework--3.4.3--aluminium--dev)

## 📍 [Help DMVCFramework and your business! Click Here to access premium contents!](https://www.patreon.com/bePatron?u=72182967)

Expand Down Expand Up @@ -225,16 +225,17 @@ Congratulations to Daniele Teti and all the staff for the excellent work!" -- Ma
> "I managed to generate an API for my application thanks to this framework, it is truly useful and efficient!" -- J. Urbani

## What's New in DMVCFramework-3.4.2-magnesium-rc2 (release candidate 2 version)
## What's New in DMVCFramework-3.4.2-magnesium (stable version)
>👉 A deep analisys of what's new in DelphiMVCFramework-3.4.2-magnesium is available on [Daniele Teti Blog]
https://www.danieleteti.it/post/delphimvcframework-3-4-2-magnesium/

## What's New in DMVCFramework-3.4.1-sodium (stable version)

## Older Versions

### What's New in DMVCFramework-3.4.1-sodium

>👉 A deep analisys of what's new in DelphiMVCFramework-3.4.1-sodium is available on [Daniele Teti Blog](https://www.danieleteti.it/post/delphimvcframework-3-4-1-sodium/) 👈

## Older Versions

### What's New in DMVCFramework-3.4.0-neon

Expand Down
2 changes: 0 additions & 2 deletions samples/activerecord_restful_crud/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/angular/server/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/avoid_mid_air_collisions_sample/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
//default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
//default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/custom_exception_handling/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/custom_logger/WebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
2 changes: 0 additions & 2 deletions samples/custom_role_auth/MyWebModuleU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ procedure TMyWebModule.WebModuleCreate(Sender: TObject);
FMVC := TMVCEngine.Create(Self,
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';
// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
7 changes: 3 additions & 4 deletions samples/htmx/Controllers/uBase.Controller.pas
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TBaseController = class(TMVCController)
public
[MVCPath(''), MVCHTTPMethod([httpGET])]
[MVCProduces('text/html')]
procedure Index;
function Index: String;

end;

Expand Down Expand Up @@ -58,10 +58,9 @@ function TBaseController.GetGenreService: TGenreService;
Result := FGenreService;
end;

procedure TBaseController.Index;
function TBaseController.Index: String;
begin
LoadView(['header', 'index', 'footer']);
RenderResponseStream;
Result := RenderViews(['header', 'index', 'footer']);
end;

procedure TBaseController.OnAfterAction(AContext: TWebContext; const AActionName: string);
Expand Down
2 changes: 1 addition & 1 deletion samples/htmx/Controllers/uMovie.Controller.pas
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ procedure TMovieController.RenderForm(const AViewNames: TArray<string>);
begin
PageData.b['InsertMode'] := FInsertMode;
PageData.b['IncludeBlankRow'] := FIncludeBlankRow;
LoadView(AViewNames);
ResponseStream.Append(RenderViews(AViewNames));
RenderResponseStream;
end;

Expand Down
2 changes: 1 addition & 1 deletion samples/htmx/uConfig.Module.pas
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ procedure TConfigModule.WebModuleCreate(Sender: TObject);
procedure(Config: TMVCConfig)
begin
// session timeout (0 means session cookie)
Config[TMVCConfigKey.SessionTimeout] := '0';

// default content-type
Config[TMVCConfigKey.DefaultContentType] := TMVCConstants.DEFAULT_CONTENT_TYPE;
// default content charset
Expand Down
19 changes: 11 additions & 8 deletions samples/htmx_mustache/WebSiteControllerU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function TWebSiteController.EditPerson(guid: string): String;
lItem.Selected := lPerson.Items.Contains(lItem.DeviceName);
end;
ViewData['deviceslist'] := lDevices;
Result := Page(['editperson']);
Result := RenderViews(['header','editperson','footer']);
finally
lDevices.Free;
end;
Expand Down Expand Up @@ -158,7 +158,7 @@ function TWebSiteController.MustacheTemplateShowCase: String;
ViewData['people'] := lPeople;
ViewData['people2'] := lPeople2;
ViewData['myobj'] := lMyObj;
Result := PageFragment(['showcase']); //it is not a "fragment" but we don't need standard headers/footer
Result := RenderView('showcase'); //it is not a "fragment" but we don't need standard headers/footer
finally
lMyObj.Free;
end;
Expand All @@ -179,7 +179,7 @@ function TWebSiteController.NewPerson: String;
lDevices := LDAL.GetDevicesList;
try
ViewData['deviceslist'] := lDevices;
Result := Page(['editperson']);
Result := RenderView('editperson');
finally
lDevices.Free;
end;
Expand All @@ -202,7 +202,7 @@ function TWebSiteController.PeopleList: String;
lPeople := LDAL.GetPeople;
try
ViewData['people'] := lPeople;
Result := Page(['people_list_search', 'people_list', 'people_list_bottom']);
Result := RenderViews(['people_list_search', 'people_list', 'people_list_bottom']);
finally
lPeople.Free;
end;
Expand All @@ -221,7 +221,7 @@ function TWebSiteController.PeopleSearch(const SearchText: String): String;
ViewData['people'] := lPeople;
if Context.Request.IsHTMX then
begin
Result := PageFragment(['people_list']);
Result := RenderView('people_list');
if SearchText.IsEmpty then
Context.Response.HXSetPushUrl('/people/search')
else
Expand All @@ -232,7 +232,8 @@ function TWebSiteController.PeopleSearch(const SearchText: String): String;
var lJSON := TJSONObject.Create;
try
lJSON.S['q'] := SearchText;
Result := Page(['people_list_search', 'people_list', 'people_list_bottom'], lJSON);
ViewData['json'] := lJSON;
Result := RenderViews(['people_list_search', 'people_list', 'people_list_bottom']);
finally
lJSON.Free;
end;
Expand Down Expand Up @@ -265,7 +266,8 @@ function TWebSiteController.ShowModal: String;
begin
var lJSON := StrToJSONObject('{"message":"Do you really want to delete row?", "title":"Bootstrap Modal Dialog"}');
try
Result := PageFragment(['modal'], lJSON);
ViewData['json'] := lJSON;
Result := RenderView('modal');
finally
lJSON.Free;
end;
Expand All @@ -278,7 +280,8 @@ function TWebSiteController.ShowModalForDelete(guid: string): String;
lJSON.S['title'] := 'Bootstrap Modal Dialog';
lJSON.S['message'] := 'Do you really want to delete row?';
lJSON.S['guid'] := guid;
Result := PageFragment(['modal'], lJSON);
ViewData['json'] := lJSON;
Result := RenderView('modal');
finally
lJSON.Free;
end;
Expand Down
2 changes: 1 addition & 1 deletion samples/htmx_mustache/htmx_mustache.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var
begin
ReportMemoryLeaksOnShutdown := True;
LogI('HTMX DMVCFramework Sample');
LogI(Format('Starting HTTP Server on port %d', [APort]));
LogI(Format('Listening on http://localhost:%d', [APort]));
ResetConsole;
LServer := TIdHTTPWebBrokerBridge.Create(nil);
try
Expand Down
27 changes: 3 additions & 24 deletions samples/htmx_mustache/htmx_mustache.dproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{563921D8-AB80-4E14-AD4E-36870C7E2008}</ProjectGuid>
<ProjectVersion>20.1</ProjectVersion>
<ProjectVersion>20.2</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>htmx_mustache.dpr</MainSource>
<Base>True</Base>
Expand Down Expand Up @@ -126,14 +126,9 @@
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp290.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="4">
<Deployment Version="5">
<DeployFile LocalName="bin\ServerSideViews.exe" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="bin\htmx_mustache.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>htmx_mustache.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="bin\htmx_mustache.exe" Configuration="Debug" Class="ProjectOutput"/>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
Expand All @@ -142,16 +137,6 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
Expand All @@ -162,12 +147,6 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
Expand Down
Loading

0 comments on commit d8987ab

Please sign in to comment.