mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 15:55:54 +01:00
3.0.0 hydrogen RC1
This commit is contained in:
parent
c237c4f049
commit
a866a37b27
@ -44,3 +44,7 @@ After
|
||||
|
||||
The memory allocated for the TJSONValue descendant (e.g. TJSONObject, TJSONArray and so on) *is no more managed by the TRESTClient itself* but must be feed by the calling code.
|
||||
|
||||
- DelphiStompClient has been removed from the core. The following method is no more available in TMVCController.
|
||||
```delphi
|
||||
function GetNewStompClient(const AClientId: string = ''): IStompClient;
|
||||
```
|
@ -285,8 +285,6 @@ resourcestring
|
||||
' Config[TMVCConfigKey.DefaultViewFileExtension] := ''html'';' + sLineBreak +
|
||||
' //view path' + sLineBreak +
|
||||
' Config[TMVCConfigKey.ViewPath] := ''templates'';' + sLineBreak +
|
||||
' //Enable STOMP messaging controller' + sLineBreak +
|
||||
' Config[TMVCConfigKey.Messaging] := ''false'';' + sLineBreak +
|
||||
' //Enable Server Signature in response' + sLineBreak +
|
||||
' Config[TMVCConfigKey.ExposeServerSignature] := ''true'';' + sLineBreak +
|
||||
' // Define a default URL for requests that don''t map to a route or a file (useful for client side web app)' +
|
||||
|
@ -33,7 +33,10 @@ package DMVC_IDE_Expert_D102Tokyo;
|
||||
requires
|
||||
rtl,
|
||||
designide,
|
||||
ExpertsCreators;
|
||||
ExpertsCreators,
|
||||
IndySystem,
|
||||
IndyProtocols,
|
||||
IndyCore;
|
||||
|
||||
contains
|
||||
DMVC.Expert.CodeGen.SourceFile in 'DMVC.Expert.CodeGen.SourceFile.pas',
|
||||
|
@ -104,6 +104,9 @@
|
||||
<DCCReference Include="rtl.dcp"/>
|
||||
<DCCReference Include="designide.dcp"/>
|
||||
<DCCReference Include="ExpertsCreators.dcp"/>
|
||||
<DCCReference Include="IndySystem.dcp"/>
|
||||
<DCCReference Include="IndyProtocols.dcp"/>
|
||||
<DCCReference Include="IndyCore.dcp"/>
|
||||
<DCCReference Include="DMVC.Expert.CodeGen.SourceFile.pas"/>
|
||||
<DCCReference Include="DMVC.Expert.Registration.pas"/>
|
||||
<DCCReference Include="DMVC.Expert.Forms.NewUnitWizard.pas">
|
||||
|
BIN
releases/dmvcframework_3_0_0_hydrogen_RC1.zip
Normal file
BIN
releases/dmvcframework_3_0_0_hydrogen_RC1.zip
Normal file
Binary file not shown.
@ -118,7 +118,6 @@ type
|
||||
StompServerPort = 'stompserverport';
|
||||
StompUsername = 'stompusername';
|
||||
StompPassword = 'stomppassword';
|
||||
Messaging = 'messaging';
|
||||
AllowUnhandledAction = 'allow_unhandled_action';
|
||||
ServerName = 'server_name';
|
||||
ExposeServerSignature = 'server_signature';
|
||||
|
@ -85,8 +85,7 @@ uses
|
||||
LoggerPro,
|
||||
IdGlobal,
|
||||
IdGlobalProtocols,
|
||||
IdURI,
|
||||
StompClient;
|
||||
IdURI;
|
||||
|
||||
type
|
||||
|
||||
@ -413,7 +412,6 @@ type
|
||||
|
||||
function GetClientId: string;
|
||||
function GetCurrentWebModule: TWebModule;
|
||||
function GetNewStompClient(const AClientId: string = ''): IStompClient;
|
||||
function GetViewModel: TMVCViewDataObject;
|
||||
function GetViewDataSets: TObjectDictionary<string, TDataSet>;
|
||||
function GetRenderedView(const AViewNames: TArray<string>): string; virtual;
|
||||
@ -433,16 +431,6 @@ type
|
||||
/// </summary>
|
||||
procedure LoadViewFragment(const AViewFragment: string);
|
||||
|
||||
procedure EnqueueMessageOnTopicOrQueue(
|
||||
const AMessage: TMVCStompMessage;
|
||||
const AContentType: string = TMVCMediaType.APPLICATION_JSON;
|
||||
const AOwns: Boolean = True); virtual;
|
||||
|
||||
function ReceiveMessageFromTopic(
|
||||
const ATimeout: Int64;
|
||||
out AMessage: TMVCStompMessage;
|
||||
const AContentType: string = TMVCMediaType.APPLICATION_JSON): Boolean; virtual;
|
||||
|
||||
function ResponseStream: TStringBuilder;
|
||||
function SessionAs<T: TWebSession>: T;
|
||||
|
||||
@ -729,8 +717,7 @@ implementation
|
||||
|
||||
uses
|
||||
MVCFramework.Router,
|
||||
MVCFramework.SysControllers,
|
||||
MVCFramework.MessagingController;
|
||||
MVCFramework.SysControllers;
|
||||
|
||||
var
|
||||
_IsShuttingDown: Int64 = 0;
|
||||
@ -1596,7 +1583,6 @@ begin
|
||||
Config[TMVCConfigKey.StompServerPort] := '61613';
|
||||
Config[TMVCConfigKey.StompUsername] := 'guest';
|
||||
Config[TMVCConfigKey.StompPassword] := 'guest';
|
||||
Config[TMVCConfigKey.Messaging] := 'false';
|
||||
Config[TMVCConfigKey.AllowUnhandledAction] := 'false';
|
||||
Config[TMVCConfigKey.ServerName] := 'DelphiMVCFramework';
|
||||
Config[TMVCConfigKey.ExposeServerSignature] := 'true';
|
||||
@ -2044,11 +2030,6 @@ procedure TMVCEngine.LoadSystemControllers;
|
||||
begin
|
||||
Log(TLogLevel.levNormal, 'ENTER: LoadSystemControllers');
|
||||
AddController(TMVCSystemController);
|
||||
if Config[TMVCConfigKey.Messaging].ToLower.Equals('true') then
|
||||
begin
|
||||
AddController(TMVCBUSController);
|
||||
Log(TLogLevel.levNormal, 'Loaded system controller ' + TMVCBUSController.QualifiedClassName);
|
||||
end;
|
||||
Log(TLogLevel.levNormal, 'EXIT: LoadSystemControllers');
|
||||
end;
|
||||
|
||||
@ -2276,28 +2257,6 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TMVCController.EnqueueMessageOnTopicOrQueue(
|
||||
const AMessage: TMVCStompMessage;
|
||||
const AContentType: string;
|
||||
const AOwns: Boolean);
|
||||
var
|
||||
Stomp: IStompClient;
|
||||
Headers: IStompHeaders;
|
||||
begin
|
||||
if Assigned(AMessage) then
|
||||
begin
|
||||
try
|
||||
Stomp := GetNewStompClient(GetClientId);
|
||||
Headers := StompUtils.NewHeaders.Add(StompUtils.NewPersistentHeader(True));
|
||||
Stomp.Send(AMessage.SmTopic, Serializer(AContentType).SerializeObject(AMessage));
|
||||
TThread.Sleep(100);
|
||||
finally
|
||||
if AOwns then
|
||||
AMessage.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TMVCController.GetClientId: string;
|
||||
begin
|
||||
Result := Session[CLIENTID_KEY];
|
||||
@ -2323,11 +2282,6 @@ begin
|
||||
Result := Engine.WebModule;
|
||||
end;
|
||||
|
||||
function TMVCController.GetNewStompClient(const AClientId: string): IStompClient;
|
||||
begin
|
||||
raise EMVCException.CreateFmt('Method %s not implemented.', ['TMVCController.GetNewStompClient']);
|
||||
end;
|
||||
|
||||
function TMVCController.GetSession: TWebSession;
|
||||
begin
|
||||
Result := GetContext.Session;
|
||||
@ -2421,25 +2375,6 @@ begin
|
||||
raise EMVCSessionExpiredException.Create('Session expired.');
|
||||
end;
|
||||
|
||||
function TMVCController.ReceiveMessageFromTopic(
|
||||
const ATimeout: Int64;
|
||||
out AMessage: TMVCStompMessage;
|
||||
const AContentType: string): Boolean;
|
||||
var
|
||||
Stomp: IStompClient;
|
||||
Frame: IStompFrame;
|
||||
begin
|
||||
Result := False;
|
||||
Stomp := GetNewStompClient(GetClientId);
|
||||
if not Stomp.Receive(Frame, ATimeout) then
|
||||
AMessage := nil
|
||||
else
|
||||
begin
|
||||
AMessage := TMVCStompMessage.Create;
|
||||
Serializer(AContentType).DeserializeObject(Frame.GetBody, AMessage);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMVCController.Redirect(const AUrl: string);
|
||||
begin
|
||||
GetContext.Response.RawWebResponse.SendRedirect(AUrl);
|
||||
|
@ -1,2 +1,2 @@
|
||||
const
|
||||
DMVCFRAMEWORK_VERSION = '3.0.0 hydrogen RC0';
|
||||
DMVCFRAMEWORK_VERSION = '3.0.0 hydrogen RC1';
|
Loading…
Reference in New Issue
Block a user