Commit Graph

224 Commits

Author SHA1 Message Date
Daniele Teti
f98d39375f CustomTypeSerializers Refactoring
Added more unit test
2017-02-10 18:48:19 +01:00
Daniele Teti
c2f51d4b11 CustomTypes + UnitTests 2017-02-10 14:20:06 +01:00
Daniele Teti
4cc5b6560c CustomTypesSerialiers 2017-02-09 19:34:12 +01:00
Daniele Teti
c80f078337 TValue de/serialization 2017-02-09 11:24:24 +01:00
Daniele Teti
9b70ee40fc IMPLEMENTED
IMVCSerUnSer = interface
    ['{1ECA942A-E3C4-45DD-9D23-C00363B5E334}']
    function SerializeObject(AObject: TObject; AIgnoredProperties: array of string): String;
    function SerializeObjectStrict(AObject: TObject): String;
    function SerializeDataSet(ADataSet: TDataSet; AIgnoredFields: array of string): String;
    function SerializeCollection(AList: TObject; AIgnoredProperties: array of string): String;
    function SerializeCollectionStrict(AList: TObject): String;
    procedure DeserializeObject(ASerializedObject: String; AObject: TObject);
    procedure DeserializeCollection(ASerializedObjectList: string; AList: IMVCList; AClazz: TClass);
  end;
2017-02-08 18:30:32 +01:00
Daniele Teti
862f31a1ce Added 'Renderer' in TMVCController 2017-02-08 11:42:35 +01:00
Daniele Teti
9ef9ede924 REMOVING WARNINGS 2017-02-07 16:32:54 +01:00
Daniele Teti
26c0eb5eb8 TEST OK FOR JSON SERIALIZER (BUILTIN JSON PARSER)
TestSerUnSerObject
TestSerUnSerObjectList
2017-02-07 16:06:58 +01:00
Daniele Teti
56b78738e4 Serializer: First TEST OK 2017-02-07 14:08:51 +01:00
Daniele Teti
c8074649a1 2.1.3 (lithium)
FIX https://github.com/danieleteti/delphimvcframework/issues/64
ADDED Unit Tests for avoid regressions
2017-01-29 19:02:41 +01:00
Daniele Teti
71907802f0 ADDED SEMANTIC VERSION (DMVCFRAMEWORK_VERSION const in MVCFramework.Commons.pas hold the current version)
Updated the IDE Expert to show the current version of the framework
FIX to the mapper about the datasets null values (needs to be chack in old Delphi versions)
FIX to the dataset boolean values
ADDED more unit tests about nullability
2017-01-29 16:11:14 +01:00
Daniele Teti
808e3902d1 Moved TMVCHTTPMethodType and TMVCHTTPMethods to MVCFramework.Commons.pas (You controllers may not compile animore without using this unit)
Better mobile support for RESTAdapter
Better IFDEFing
2017-01-18 21:54:16 +01:00
Daniele Teti
ccc8ee90ab FIX OnBeforeAction (Thank you to Marco Mottadelli)
More unit tests
Refactoring for XE6
Updated copyright to 2017
2017-01-05 12:45:51 +01:00
Daniele Teti
4092b08179 New Conditional Defines:
USEFIREDAC
USEDBX
STARTEREDITION
2017-01-03 13:35:49 +01:00
Daniele Teti
32e7a8d325 Added features selection in dmvcframework.inc
Added MVCFramework.Patches.pas which should try to uniform interfaces of the changed classes in different versions of Delphi
2016-12-30 20:42:49 +01:00
Daniele Teti
05fb9259ae Compilable with XE6 and older
New unit tests
2016-12-29 19:29:22 +01:00
Daniele Teti
3b1e19ec40 https://github.com/danieleteti/delphimvcframework/issues/63 2016-12-28 10:01:02 +01:00
Daniele Teti
c8d176485f Fix with german chars 2016-12-12 14:37:32 +01:00
Daniele Teti
7c2acc9738 Encoding fixes
Preparation for output compression
More unit tests
2016-12-07 19:36:03 +01:00
Daniele Teti
60ef18d148 ADDED
Config[TMVCConfigKey.FallbackResource]

Defines a default URL for requests that don't map to a route or a file (useful for client side web app)

The experts generates a Config[TMVCConfigKey.FallbackResource] which ponts to 'index.html'
2016-12-07 12:35:46 +01:00
Daniele Teti
81744b892e Merge changes from https://github.com/danieleteti/delphimvcframework/pull/60
Some refactoring needed to be coherent to the rest of the framework
Added a new sample to chow customsession utilization
2016-12-05 15:51:05 +01:00
Daniele Teti
9e76485268 Samples Refactoring 2016-11-27 23:18:32 +01:00
Daniele Teti
56a7c8311d FIX Render(Stream,False)
Added Ownership to TDuckTypedList
Added 2 more unit tests
2016-11-18 18:25:50 +01:00
spinettaro
a87be2a8cf added unit tests to enhance Stream Rendering Memory Management 2016-11-18 18:02:48 +01:00
Daniele Teti
913f0449ce Fixing some paths and warnings in sample projects 2016-11-18 00:17:41 +01:00
Daniele Teti
25177d957f All the unit tests are now merged in 1 project.
Submodules update, samples refactoring, build improvements.
2016-11-13 21:00:54 +01:00
spinettaro
3f0eb0d040 added support to serialize json null value as nil in object property
added relative test TestJSONObjectToObjectWithNullInJSONString
2016-10-26 14:42:45 +02:00
Daniele Teti
160bb8d51e ADDED
AllowedOriginURL: string = '*'
AllowsCredentials: Boolean = true

In CORS Middleware
2016-10-12 13:11:19 +02:00
danieleteti
bd10056c6f https://github.com/danieleteti/delphimvcframework/issues/56 2016-10-11 11:39:57 +02:00
danieleteti
4d1427d859 -IDE Expert small bug fix
- ADDED Paremeter "ARewindStream" to procedure SendStream(AStream: TStream; AOwnStream: Boolean = true;
      ARewindStream: Boolean = false); virtual;
2016-10-10 16:11:48 +02:00
danieleteti
78f635c720 Added Apache 2.4 for windows in the "apache module sample" folder. 2016-10-10 15:49:10 +02:00
danieleteti
3672a73b8d Names refactoring
Added TMVCController.RenderWrappedList to renders heterogeneous lists
2016-09-30 11:44:30 +02:00
spinettaro
d689e92642 added support in TMVCController and ObjectsMappers to serialize a IWrappedList
added link to LoggerPro in tests projects
2016-09-29 18:17:26 +02:00
danieleteti
d93d3f5a6b Missed TestServerControllerPrivateU.pas 2016-09-29 16:44:46 +02:00
danieleteti
83f5b378ed Possibile FIX for a RTL bug. IT works now on Berlin and Seattle. 2016-09-25 22:25:06 +02:00
danieleteti
c443fffa44 FIX https://github.com/danieleteti/delphimvcframework/issues/48 2016-09-20 11:27:37 +02:00
danieleteti
6842f5efec IDE Expert: Load optimized configuration for the default generated project (MaxConnections and ListenQueue)
small optimization for body reading in the TWebContext
add sample for CustomAuth
2016-09-20 11:10:47 +02:00
danieleteti
0d3b591174 Added CopyRight info were not present 2016-09-18 19:19:43 +02:00
danieleteti
3157e6e018 Added unit to contains auth handlers for basicauth and customauth 2016-09-18 12:02:27 +02:00
danieleteti
f0670af618 Added custom authentication and authorization middleware 2016-09-16 23:55:11 +02:00
danieleteti
33d62713df Small FIX RESTClient 2016-09-13 19:10:34 +02:00
danieleteti
82b5a1fb48 Updated SUBMODULE 2016-09-06 15:02:50 +02:00
danieleteti
6875ff3704 Added LoggerPro as git submodule
Updated MVCFramework.Logger.pas to use LoggerPro instead of the modified version of IOCPLogger
Added CustomLoggerSample.dproj
Removed IOCP dependencies
2016-09-06 10:33:09 +02:00
danieleteti
d8abc1590a FIX project file 2016-09-05 15:39:24 +02:00
danieleteti
be7d5d7183 Send DocumentIndex if request route = '/' and index file exists
FIX Charset issue on static contents
2016-09-05 15:34:55 +02:00
danieleteti
b760489777 enabled for console unit test 2016-08-24 16:08:32 +02:00
danieleteti
5601767e04 - added method TWebContext.SessionStarted (check sample Sessions to see how it works)
- added method TWebContext.SessionID
- added unit test for TWebContext.SessionStarted
2016-06-28 13:44:09 +02:00
danieleteti
06e75e148b FIX a bug in /system/describeserver.info 2016-06-23 15:18:50 +02:00
danieleteti
1ef246a589 - Added strongly typed actions
- TWebContext param in the actions is optional
- In case of "action not found", the server dont returns NEVER the document index
- Refactoring
- More unit tests
- BasicDemo updated with typed actions
- Copyright updated (just formatting)
2016-06-22 17:50:31 +02:00
Ezequiel Juliano Müller
04b83cc0f5 Refactoring to:
* Enable working with listeners in a DI context.
* Class Changes to provide a better understanding of the functionality;
* Removal singletons variables (not the framework that must manage it);
* README update;
2016-06-16 17:13:35 -03:00
danieleteti
e1225fdcbe ADDED JWT Checks for: NotBefore, ExpirationTime, IssuedAt
Updated JWT sample
Added more unit tests
2016-05-21 21:56:29 +02:00
danieleteti
e2e5d79f30 removed dmvcframework.inc
added unittest for JWT
2016-05-19 11:22:58 +02:00
danieleteti
902732bcdf changed Body: TStringStream to Body: TStream 2016-05-13 17:20:11 +02:00
danieleteti
d11111aa41 ADDED cookies support to the rest client
ADDED demo for cookies utilization
REFACTORED some samples
2016-04-24 19:08:25 +02:00
danieleteti
8f1d0ddf56 ADD Render(TTextWriter) 2016-04-22 09:46:28 +02:00
danieleteti
cacdabdbb7 Session refactoring
Now session is available also with Context.Session
2016-04-03 22:36:13 +02:00
danieleteti
06c9caa616 ADDED Mapper.LoadJSONObjectToObject
ADDED UnitTest for Mapper.LoadJSONObjectToObject
2016-03-24 15:30:18 +01:00
danieleteti
388ed31a0b FIX Basd64 Stream serialization
ADDED Unit test for Stream de/serialization
2016-03-23 00:29:58 +01:00
danieleteti
d39854a8b3 Integrated the path from Mathias Pannier regarding http://qc.embarcadero.com/wc/qcmain.aspx?d=67350 2016-03-01 22:50:32 +01:00
Ezequiel Juliano Müller
95427f674b Merge branch 'master' of https://github.com/danieleteti/delphimvcframework into HEAD
# Conflicts:
#	sources/MVCFramework.Server.pas
#	sources/MVCFramework.pas
#	unittests/Several/FrameworkTestsU.pas
2016-02-29 10:08:48 -03:00
Ezequiel Juliano Müller
756b7683a0 Add constructor delegate to controllers. This aims to integrate with frameworks to dependency injection. 2016-02-29 09:48:36 -03:00
danieleteti
51fe8bac94 MAPPER FIX about ISOStrToDateTime without seconds
MAPPER UnitTests Refactoring
2016-02-27 10:08:07 +01:00
Ezequiel Juliano Müller
caae47e089 fixes for compatibility with authentication interface. 2016-02-25 08:40:08 -03:00
danieleteti
25b064fec2 Introduced XmlDoc on IMVCMiddleware
Updated unit test for new middleware interface
2016-02-23 23:22:44 +01:00
danieleteti
1a19fa9e1d updated facebook group logo
added a unit test
2016-01-13 12:34:12 +01:00
danieleteti
6ddef75804 -New Build System based on Python 3.5 script
-Cleanup
2016-01-01 23:01:49 +01:00
Ezequiel Juliano Müller
39d19db773 Refactored, adjusted, retested and moved tests 2015-12-22 09:29:25 -02:00
danieleteti
e7eb4949ab Small fixes for SOAPREST sample 2015-12-04 16:56:28 +01:00
danieleteti
7ca59a3b88 Mustache Server Side Views 2015-10-18 16:35:50 +02:00
danieleteti
6750ea7f5f REMOVED some warnings
CHANGED Logger in winecellarWITHDORM Sample
Now ObjectsMappers serialize differently String and AnsiString
ADDED SAMPLE "deserilizeandserialize"
2015-10-17 12:00:05 +02:00
Ezequiel
14ec5fc0a7 Update README.md and adjustment in unit testing 2015-06-15 17:51:36 -03:00
Ezequiel
97d1d6fe1b Addition of MVCFramework.Server.pas with MVCServerInfo, MVCServer, MVCDefaultSecurity and MVCServerContainer. 2015-06-15 13:57:46 -03:00
daniele.teti
94d1795f07 Updated to XE8 2015-04-10 10:29:40 +00:00
daniele.teti
2ea8062889 FIX Mapper.JSONObjectFieldsToObject 2015-04-10 07:36:35 +00:00
daniele.teti
1c0ebb763d FIX serialization with fields.
thank you M. Del Magno
2015-04-09 17:57:13 +00:00
daniele.teti
02511a14e2 + MERGE FROM "AUTH" FEATURE BRANCH 2015-04-01 15:01:23 +00:00
spinettaro
5e6ba9b3f0 implemented Asynchronous call
added relative test
2015-03-13 08:59:54 +00:00
daniele.teti
c8748e829e Added unit test and a minor change to the BOs.pas 2015-02-19 10:35:49 +00:00
ro
a876c3aff4 added Asynch functionality in RESTAdapter
added relative tests
updated wincellarclientRESTAdapter sample with Asynch function
2015-02-17 08:40:55 +00:00
daniele.teti
d864d95ff0 - removed MLeak into TestSerializeUsingFieldsWithNotExixtentPropetyInJSONObject test 2015-02-16 13:37:05 +00:00
daniele.teti
1936fdc225 - refactoring
- cleaning up
- added "low-level" serialization based on fields (and not properties)
- added $dmvc_classname property handling for fields serialization
- added more unittests
2015-02-16 13:25:09 +00:00
ro
4c2d51fe2d added Free of Body parameter if OwnsObject is true
initial implementation of asynch call
2015-01-19 14:28:04 +00:00
ro
c1f030d9b5 fixed Error on map ParamAttribute and BodyAttribute
added overload of HasAttribute in TRTTIUtils
fixed error in objectsmappers whene JSONValue is nil
added relative tests
2015-01-17 16:19:09 +00:00
ro
0296ff0e0f fixed all memory leaks on FrameworkTests project 2015-01-15 09:39:54 +00:00
ro
037f4747a4 fixed Memory Leak on test TestObjectToJSONObjectAndBackWithStringStreamUTF16 and TestObjectToJSONObjectAndBackWithStringStreamUTF8; 2015-01-15 09:32:29 +00:00
ro
fb6cce5411 fixed Memory Leak on test TestCheckMapperSerializeAsStringIsEmptyStrIfObjIsNil 2015-01-14 13:34:47 +00:00
daniele.teti
f20a7fe443 FIX for DataSetSerialization 2015-01-14 13:13:48 +00:00
ro
1ec03beec8 added RESTAdapterTest 2015-01-14 11:23:28 +00:00
ro
eed6ecf628 added no-Generics JSONArrayToObjectList
added TFieldNamePolicy enum, to manage the case serialization of DataSet to and from JSONObject
added RESTAdapter unit to turn your REST API into a Delphi Interface (beta)
added all relatives test for changes
minor bug fix
2015-01-14 10:39:44 +00:00
ro
103bb2ab3b Changed behavior of ObjectToJSONObject: A nil object with MapperSerializeAsString Attribute is deserialized like an empty string
Added relative test
2014-11-26 11:27:56 +00:00
ro
ed03cfecb2 added possibility to choose the Encoding for MapperSerializeAsString attribute (UTF-8 default)
added tests for UTF-8 and UTF-16 encoding
2014-11-24 15:26:02 +00:00
daniele.teti
e176fa676a 2014-10-26 19:48:52 +00:00
daniele.teti
e7ffca72df XE7 Support (beta) 2014-09-05 10:47:40 +00:00
daniele.teti
6bc4386ee5 Now, the log path is ALWAYS at the same level of the compiled module 2014-07-18 08:59:19 +00:00
daniele.teti
0b6df41668 BUGFIXES
New sample: articles_crud
2014-06-27 13:30:39 +00:00
daniele.teti
0e9aad849a FIX FOR ISAPI modules on XE6 2014-05-30 09:29:58 +00:00
daniele.teti
8fc2614a1d Now the JSONObjectToObject can deserialize the following tkClass:
- TStream
 - TObjectList<T> (only if the list itself is already created on the object)
 - TObject (only if the list itself is already created on the object)

MapperItemClassType has been aliased with MapperListOf to be more compliant to DORM and can be on the property itself or in the declaration of the type of the property (Check TEST TestComplexObjectToJSONObjectAndBack test)
2014-05-22 21:37:13 +00:00
daniele.teti
205ee52196 BETA support for Apache web server using Delphi XE6 2014-05-14 13:55:41 +00:00
daniele.teti
7dad441780 FIX for issue noticed by D.G. 2014-04-21 22:20:00 +00:00
daniele.teti
cae068501c Updated to Delphi XE6 2014-04-16 20:52:25 +00:00
daniele.teti
2466c75615 2014-04-10 15:30:39 +00:00
daniele.teti
72696ceeed FIX Encoding stuff 2014-04-10 11:56:23 +00:00
daniele.teti
698aaf7daa 2014-04-02 18:28:53 +00:00
daniele.teti
19d0686644 Refactoring
ADD Session demo
2014-03-31 22:02:31 +00:00
daniele.teti
f2ad4087f0 ADD Middleware like (more or less) NODEJS EXPRESS library 2014-03-31 09:40:25 +00:00
daniele.teti
c1eb644550 ADD Middleware like (more or less) NODEJS EXPRESS library 2014-03-31 09:25:16 +00:00
daniele.teti
d4d1a6db0c MVCConsumes bugfix 2014-03-24 16:37:08 +00:00
daniele.teti
b01e933b4a ADDED TDataset Class Helpers
TDataSetHelper = class helper for TDataSet
  public
    function AsJSONArray: TJSONArray;
    function AsJSONObject: TJSONObject;
    procedure LoadFromJSONObject(AJSONObject: TJSONObject);
    procedure LoadFromJSONArray(AJSONArray: TJSONArray);
    function AsObjectList<T: class, constructor>(CloseAfterScroll: boolean = false): TObjectList<T>;
    function AsObject<T: class, constructor>(CloseAfterScroll: boolean = false): T;
  end;
2014-03-12 23:46:29 +00:00
daniele.teti
ab0fc4758b ADD Mapper.DataSetToJSONObject
ADD Mapper.JSONObjectToDataSet

ADD UnitTests
2014-03-12 23:29:23 +00:00
daniele.teti
0f347fc567 ADD ISAPI SAMPLE
Small refactoring
2014-03-10 16:39:29 +00:00
daniele.teti
72e32bd0dc 2014-03-03 14:30:38 +00:00
daniele.teti
9705ce0384 + support for isapi app 2014-02-24 09:20:34 +00:00
daniele.teti
1d1ff8de0e ADD Fixed behaviour of MVCAfterCreate/MVCBeforeDestroy 2013-12-05 15:19:01 +00:00
daniele.teti
6e03e7efd1 ADD CopyObjectAs<T> 2013-12-04 11:08:32 +00:00
daniele.teti
1a165ad571 ADD UnitTest for ObjectToJSONObject and Back
ADD support for mapping of TTimeStamp type
2013-11-19 17:17:06 +00:00
daniele.teti
35b7732b40 2013-11-17 23:44:40 +00:00
daniele.teti
c726fceb23 ADD BodyAs<T> and BodyAsListOf<T> in the TMVCRequest 2013-11-17 23:16:59 +00:00
daniele.teti
e5c854fb64 ADD HTML error page 2013-11-11 11:23:49 +00:00
daniele.teti
53de10fbda MVCProducesAttribute similar to JAX-RS
MVCConsumesAttribute similar to JAX-RS

REFACTORING
FIX for Asynch
More samples
2013-11-09 13:22:11 +00:00
daniele.teti
d03c788a68 2013-11-09 09:05:14 +00:00
daniele.teti
d0a5ef79d2 2013-11-08 22:10:25 +00:00
daniele.teti
d4bc60c2de 2013-11-08 09:07:53 +00:00
daniele.teti
b7e3d18579 UPD configurable encoding 2013-11-05 13:57:50 +00:00
daniele.teti
ae48251653 UnitTests 2013-10-30 00:09:09 +00:00