change the way how winix answer is created

Now we can return ezc content and models serialized in the same json structure,
Xml and Csv are not implemented yet.
Ezc frames are returned in 'ezc_frames' field.
Main ezc stream is returned in 'main_stream' field.
Frame url parameter can take more than one frame (names separated by commas).
Honor Accept http header (AcceptParser).

Samples:
--------
http://domain.tld/dir/controller
returns html answer from the main ezc stream

http://domain.tld/dir/controller/container:raw
returns html answer from the main ezc stream (the same as above)

http://domain.tld/dir/controller/frame:abc
returns "abc" frame as html

http://domain.tld/dir/controller/container:json
returns all serialized models to json and no ezc streams

http://domain.tld/dir/controller/container:xml
returns all serialized models to xml and no ezc streams (not implemented yet)

http://domain.tld/dir/controller/container:json/frame:abc,xyz
returns all serialized models to json and two frames in 'ezc_frames' object

http://domain.tld/dir/controller/container:json/all_frames
returns all serialized models to json and all frames in 'ezc_frames' object

http://domain.tld/dir/controller/container:json/main_stream
returns all serialized models and the main ezc stream in 'main_stream' field

http://domain.tld/dir/controller/container:json/main_stream/all_frames
returns all serialized models to json, all frames and the main stream
This commit is contained in:
2022-02-01 18:44:23 +01:00
parent 227dd923d6
commit f7b5ac0dc8
17 changed files with 695 additions and 395 deletions

View File

@@ -1051,6 +1051,8 @@ filters.o: ../../../pikotools/src/convert/convert.h
filters.o: ../../../pikotools/src/convert/inttostr.h
filters.o: ../../../pikotools/src/convert/patternreplacer.h
filters.o: ../../../pikotools/src/convert/double.h
filters.o: ../../../pikotools/src/convert/misc.h
filters.o: ../../../pikotools/src/utf8/utf8_stream.h
generic.o: templates.h ../../../ezc/src/ezc.h ../../../ezc/src/generator.h
generic.o: ../../../ezc/src/blocks.h ../../../ezc/src/item.h
generic.o: ../../../ezc/src/cache.h ../../../ezc/src/functions.h

View File

@@ -383,7 +383,14 @@ void winix_is_htmx_request(Info & i)
void winix_frame_is(Info & i)
{
i.res = cur->request->frame == i.par;
for(std::wstring & f: cur->request->send_frames)
{
if( f == i.par )
{
i.res = true;
break;
}
}
}