diff --git a/Debug/main.cpp.o b/Debug/main.cpp.o index c2a0402..03b08e6 100644 Binary files a/Debug/main.cpp.o and b/Debug/main.cpp.o differ diff --git a/Debug/main.cpp.o.d b/Debug/main.cpp.o.d index 98d55e9..91f73d1 100644 --- a/Debug/main.cpp.o.d +++ b/Debug/main.cpp.o.d @@ -5,17 +5,19 @@ Debug/main.cpp.o: main.cpp ../ServerCore/includes ../ServerCore/EPoll.h \ ../ServerCore/IPAddress.h ../ServerCore/SessionFilter.h \ ../ServerCore/Command.h ../ServerCore/ConsoleServer.h \ ../ServerCore/TCPServerSocket.h ../ServerCore/Service.h \ - ../ServerCore/CommandList.h ../ServerCore/EPoll.h \ - ../ServerCore/Exception.h ../ServerCore/File.h ../ServerCore/Log.h \ - ../ServerCore/IPAddress.h HTTPService.h ../ServerCore/Service.h \ - HTTPSessions.h HTTPRequest.h ../CoreUtils/PString.h \ - ../CoreUtils/includes ../CoreUtils/IMFMessage.h ../CoreUtils/PString.h \ - ../CoreUtils/IMFHeader.h ../CoreUtils/IMFRequest.h \ - ../CoreUtils/IMFBody.h ../CoreUtils/IMFRequest.h \ - ../CoreUtils/IMFResponse.h ../CoreUtils/IMFMessage.h HTTPPageList.h \ - ../ServerCore/Session.h __index.h HTTPPage.h HTTPSession.h __script.h \ + ../ServerCore/CommandList.h ../ServerCore/IPAddressList.h \ + ../ServerCore/EPoll.h ../ServerCore/Exception.h ../ServerCore/File.h \ + ../ServerCore/Log.h ../ServerCore/IPAddress.h HTTPService.h \ + ../ServerCore/Service.h HTTPSessions.h HTTPRequest.h \ + ../CoreUtils/PString.h ../CoreUtils/includes ../CoreUtils/IMFMessage.h \ + ../CoreUtils/PString.h ../CoreUtils/IMFHeader.h \ + ../CoreUtils/IMFRequest.h ../CoreUtils/IMFBody.h \ + ../CoreUtils/IMFRequest.h ../CoreUtils/IMFResponse.h \ + ../CoreUtils/IMFMessage.h HTTPPageList.h ../ServerCore/Session.h \ + __index.h HTTPPage.h HTTPSession.h ../JET/Variables.h __script.h \ __editview.h __style.h __setupadmin.h __favicon_ico.h __welcome.h \ - __mainmenu.h __newview.h HTTPHandler.h ../ServerCore/Command.h + __mainmenu.h __newview.h __configure.h HTTPHandler.h \ + ../ServerCore/Command.h ../ServerCore/includes: @@ -51,6 +53,8 @@ Debug/main.cpp.o: main.cpp ../ServerCore/includes ../ServerCore/EPoll.h \ ../ServerCore/CommandList.h: +../ServerCore/IPAddressList.h: + ../ServerCore/EPoll.h: ../ServerCore/Exception.h: @@ -99,6 +103,8 @@ HTTPPage.h: HTTPSession.h: +../JET/Variables.h: + __script.h: __editview.h: @@ -115,6 +121,8 @@ __mainmenu.h: __newview.h: +__configure.h: + HTTPHandler.h: ../ServerCore/Command.h: diff --git a/HTTPHandler.cpp b/HTTPHandler.cpp index afc4d59..1d4b4d1 100644 --- a/HTTPHandler.cpp +++ b/HTTPHandler.cpp @@ -12,21 +12,16 @@ namespace http { coreutils::PString request1(request); HTTPRequest httpRequest(request1); - core::Log(core::LOG_DEBUG_2) << "Host value is " << httpRequest.getHeader("Host"); - core::Log(core::LOG_DEBUG_3) << "Request: " << request; - HTTPSession *httpSession = ((HTTPService &)session->service).httpSessions.findSessionByHeader(httpRequest); std::stringstream content; - if(((HTTPService &)session->service).pageList.processRequest(httpRequest.request.getURI(), session, httpSession, httpRequest, content)) { - httpRequest.response.setProtocol(httpRequest.request.getProtocol()); + if(((HTTPService &)session->service).pageList.processRequest(httpRequest, session, httpSession, content)) { httpRequest.response.setCode("200"); httpRequest.response.setText("OK"); data << httpRequest.response.getResponse(content.str()); } else { - httpRequest.response.setProtocol(httpRequest.request.getProtocol()); httpRequest.response.setCode("404"); httpRequest.response.setText("Not Found"); data << httpRequest.response.getResponse(content.str()); diff --git a/HTTPPageList.cpp b/HTTPPageList.cpp index 20f0db7..436b4f5 100644 --- a/HTTPPageList.cpp +++ b/HTTPPageList.cpp @@ -2,10 +2,11 @@ namespace http { - bool HTTPPageList::processRequest(std::string request, core::Session *session, HTTPSession *httpSession, HTTPRequest &httpRequest, std::stringstream &data) { + bool HTTPPageList::processRequest(HTTPRequest &httpRequest, core::Session *session, HTTPSession *httpSession, std::stringstream &data) { + httpRequest.response.setProtocol(httpRequest.request.getProtocol()); for(auto *page : pages) { - if(page->check(request)) { - page->processCommand(request, session, httpSession, httpRequest, data); + if(page->check(httpRequest.request.getURI())) { + page->processCommand(httpRequest.request.getURI(), session, httpSession, httpRequest, data); return true; } } @@ -15,7 +16,6 @@ namespace http { void HTTPPageList::add(HTTPPage &page, std::string name) { page.name = name; pages.push_back(&page); - } void HTTPPageList::remove(HTTPPage &page) {} diff --git a/HTTPPageList.h b/HTTPPageList.h index 6342f1f..91bbd32 100644 --- a/HTTPPageList.h +++ b/HTTPPageList.h @@ -12,6 +12,7 @@ #include "__welcome.h" #include "__mainmenu.h" #include "__newview.h" +#include "__configure.h" namespace http { @@ -28,9 +29,10 @@ namespace http { add(welcome, "/welcome"); add(mainmenu, "/mainmenu"); add(newview, "/newview"); + add(configure, "/configure"); } - bool processRequest(std::string request, core::Session *session, HTTPSession *httpSession, HTTPRequest &httpRequest, std::stringstream &data); + bool processRequest(HTTPRequest &httpRequest, core::Session *session, HTTPSession *httpSession, std::stringstream &data); void add(HTTPPage &page, std::string name = ""); @@ -49,6 +51,7 @@ namespace http { __welcome welcome; __mainmenu mainmenu; __newview newview; + __configure configure; }; diff --git a/HTTPServer.mk b/HTTPServer.mk index 9fefb24..b6b704d 100644 --- a/HTTPServer.mk +++ b/HTTPServer.mk @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=Brad Arant -Date :=10/07/19 +Date :=01/08/19 CodeLitePath :=/home/bradarant/.codelite LinkerName :=/usr/bin/x86_64-linux-gnu-g++ SharedObjectLinkerName :=/usr/bin/x86_64-linux-gnu-g++ -shared -fPIC @@ -36,7 +36,7 @@ ObjectsFileList :="HTTPServer.txt" PCHCompileFlags := MakeDirCommand :=mkdir -p LinkOptions := -IncludePath := $(IncludeSwitch). $(IncludeSwitch). $(IncludeSwitch)../ServerCore/ $(IncludeSwitch)../CoreUtils +IncludePath := $(IncludeSwitch). $(IncludeSwitch). $(IncludeSwitch)../ServerCore/ $(IncludeSwitch)../CoreUtils $(IncludeSwitch)../JET IncludePCH := RcIncludePath := Libs := $(LibrarySwitch)ServerCore $(LibrarySwitch)CoreUtils $(LibrarySwitch)pthread $(LibrarySwitch)uuid diff --git a/HTTPServer.project b/HTTPServer.project index 4e90b45..7476bcb 100644 --- a/HTTPServer.project +++ b/HTTPServer.project @@ -24,6 +24,7 @@ + @@ -42,6 +43,7 @@ + diff --git a/HTTPSession.cpp b/HTTPSession.cpp index 2b5b254..2edd3de 100644 --- a/HTTPSession.cpp +++ b/HTTPSession.cpp @@ -6,7 +6,6 @@ namespace http { sessionId = ""; } - HTTPSession::HTTPSession(std::string sessionId) { this->sessionId = sessionId; } diff --git a/HTTPSession.h b/HTTPSession.h index 2e9e7a8..5bb9478 100644 --- a/HTTPSession.h +++ b/HTTPSession.h @@ -2,6 +2,7 @@ #define __HTTPSession_h__ #include "includes" +#include "Variables.h" namespace http { @@ -12,13 +13,12 @@ namespace http { HTTPSession(std::string sessionId); std::string getSessionId(); - jet::Variables sessionVariables; - jet::Variables cgiFormVariables; +// jet::Variables sessionVariables; +// jet::Variables cgiFormVariables; private: std::string sessionId; - }; } diff --git a/JETServer Concepts.aux b/JETServer Concepts.aux new file mode 100644 index 0000000..f89d2e9 --- /dev/null +++ b/JETServer Concepts.aux @@ -0,0 +1,41 @@ +\relax +\@writefile{toc}{\contentsline {chapter}{\numberline {1}Basic Concepts}{5}} +\@writefile{lof}{\addvspace {10\p@ }} +\@writefile{lot}{\addvspace {10\p@ }} +\@writefile{toc}{\contentsline {section}{\numberline {1.1}Sessions}{5}} +\@writefile{toc}{\contentsline {section}{\numberline {1.2}Views}{5}} +\@writefile{toc}{\contentsline {subsection}{\numberline {1.2.1}View Data Sources}{6}} +\@writefile{toc}{\contentsline {section}{\numberline {1.3}View Components}{6}} +\@writefile{toc}{\contentsline {section}{\numberline {1.4}Forms}{7}} +\@writefile{toc}{\contentsline {section}{\numberline {1.5}Image Library}{7}} +\@writefile{toc}{\contentsline {section}{\numberline {1.6}Work Flow Networks}{7}} +\@writefile{toc}{\contentsline {section}{\numberline {1.7}Requests}{7}} +\@writefile{toc}{\contentsline {section}{\numberline {1.8}Business Entities}{8}} +\@writefile{toc}{\contentsline {section}{\numberline {1.9}Microservice Methods}{8}} +\@writefile{toc}{\contentsline {section}{\numberline {1.10}URIs}{9}} +\@writefile{toc}{\contentsline {section}{\numberline {1.11}Packages}{9}} +\@writefile{toc}{\contentsline {chapter}{\numberline {2}ServerCore Network Platform}{11}} +\@writefile{lof}{\addvspace {10\p@ }} +\@writefile{lot}{\addvspace {10\p@ }} +\@writefile{toc}{\contentsline {chapter}{\numberline {3}User Interfaces and Tools}{13}} +\@writefile{lof}{\addvspace {10\p@ }} +\@writefile{lot}{\addvspace {10\p@ }} +\@writefile{toc}{\contentsline {section}{\numberline {3.1}View Layout Editor}{13}} +\@writefile{toc}{\contentsline {section}{\numberline {3.2}Business Entity Editor}{13}} +\@writefile{toc}{\contentsline {section}{\numberline {3.3}Storyboard Editor}{14}} +\@writefile{toc}{\contentsline {chapter}{\numberline {4}JET Tag Reference}{15}} +\@writefile{lof}{\addvspace {10\p@ }} +\@writefile{lot}{\addvspace {10\p@ }} +\@writefile{toc}{\contentsline {section}{\numberline {4.1}CALL}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.2}COMMENT}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.3}DATABASE}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.4}EXCLUDE}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.5}EXTRACT}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.6}FOR}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.7}IF.. ELSE}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.8}IFNOROW... ELSE}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.9}IFROW... ELSE}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.10}SYSTEM}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.11}TAG}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.12}WHILE}{16}} +\@writefile{toc}{\contentsline {section}{\numberline {4.13}WHILEROW}{16}} diff --git a/JETServer Concepts.log b/JETServer Concepts.log new file mode 100644 index 0000000..d6aa9f8 --- /dev/null +++ b/JETServer Concepts.log @@ -0,0 +1,101 @@ +This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2019.5.23) 22 JUL 2019 15:39 +entering extended mode + restricted \write18 enabled. + %&-line parsing enabled. +**"JETServer Concepts.tex" +(./JETServer Concepts.tex +LaTeX2e <2017-04-15> +Babel <3.18> and hyphenation patterns for 5 language(s) loaded. +(/usr/share/texlive/texmf-dist/tex/latex/base/book.cls +Document Class: book 2014/09/29 v1.4h Standard LaTeX document class +(/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo +File: bk10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) +) +\c@part=\count79 +\c@chapter=\count80 +\c@section=\count81 +\c@subsection=\count82 +\c@subsubsection=\count83 +\c@paragraph=\count84 +\c@subparagraph=\count85 +\c@figure=\count86 +\c@table=\count87 +\abovecaptionskip=\skip41 +\belowcaptionskip=\skip42 +\bibindent=\dimen102 +) +(./JETServer Concepts.aux) +\openout1 = `"JETServer Concepts.aux"'. + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3. +LaTeX Font Info: ... okay on input line 3. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3. +LaTeX Font Info: ... okay on input line 3. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3. +LaTeX Font Info: ... okay on input line 3. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3. +LaTeX Font Info: ... okay on input line 3. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3. +LaTeX Font Info: ... okay on input line 3. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3. +LaTeX Font Info: ... okay on input line 3. + [1 + + +{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2 + +] (./JETServer Concepts.toc +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line 2. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <5> on input line 2. +) +\tf@toc=\write3 +\openout3 = `"JETServer Concepts.toc"'. + + [3] [4] +Chapter 1. +[5 + +] [6] [7] [8] [9] [10 + +] +Chapter 2. +[11] [12 + +] +Chapter 3. + +Underfull \vbox (badness 7759) has occurred while \output is active [] + + [13] +[14] +Chapter 4. + +Underfull \vbox (badness 10000) has occurred while \output is active [] + + [15 + +] +[16] (./JETServer Concepts.aux) ) +Here is how much of TeX's memory you used: + 247 strings out of 494880 + 2776 string characters out of 6179601 + 54663 words of memory out of 5000000 + 3647 multiletter control sequences out of 15000+600000 + 7069 words of font info for 25 fonts, out of 8000000 for 9000 + 36 hyphenation exceptions out of 8191 + 23i,4n,19p,479b,141s stack positions out of 5000i,500n,10000p,200000b,80000s + +Output written on "JETServer Concepts.pdf" (16 pages, 100694 bytes). +PDF statistics: + 76 PDF objects out of 1000 (max. 8388607) + 52 compressed objects within 1 object stream + 0 named destinations out of 1000 (max. 500000) + 1 words of extra memory for PDF output out of 10000 (max. 10000000) + diff --git a/JETServer Concepts.pdf b/JETServer Concepts.pdf new file mode 100644 index 0000000..05874ce Binary files /dev/null and b/JETServer Concepts.pdf differ diff --git a/JETServer Concepts.synctex.gz b/JETServer Concepts.synctex.gz new file mode 100644 index 0000000..f63f065 Binary files /dev/null and b/JETServer Concepts.synctex.gz differ diff --git a/JETServer Concepts.tex b/JETServer Concepts.tex new file mode 100644 index 0000000..9633f9d --- /dev/null +++ b/JETServer Concepts.tex @@ -0,0 +1,211 @@ +\documentclass[10pt]{book} + +\begin{document} + +\begin{titlepage} + \begin{center} + \vspace*{1cm} + + \textbf{JETServer Concepts} + + \vspace{0.5cm} + JETServer Concepts + + \vspace{1.5cm} + + \textbf{Bradford M. Arant Sr.} + + \vfill + + A whitepaper on an advanced microservices development environment\\ + for the cloud + + \vspace{0.8cm} + + \end{center} +\end{titlepage} + +\tableofcontents + +\chapter{Basic Concepts} + +In this chapter we will cover the components that make up the JETServer environment. + +\section{Sessions} + +Sessions provide a congruent and flowing state management for a connected browser. The states of various elements are stored and kept as a part of the session information so a browser refresh will not disrupt the work flow intended by the application logic. + +The Session Id is maintained on the browser as a cookie. The cookie is issued to the browser on the very first response from the first request to the server. + +All API interactions are identified as being part of a session. A browser can only have one session per domain. Sessions can support multiple window instances and is basically the authorization token. The server can issue a new Session Id in a response to the browser at any time which will reset the cookie being created to maintin the Session Id. + +The session mechanism will attempt to maintain a \emph{state} of the interaction of the request objects present in the view port of the browser. Session variables also maintain a server based data environment for the session. Session variables are available to the views and microservice methods using the \$[:\emph{variable-name}] syntax. + +As requests are placed the request URI is saved to the http session. If needed, perhaps because of a refresh, the page state can be recreated from the saved URI list. Other data and state information can be stored to the session as well. + +\section{Views} + +Views are document sections that can be placed into the page. Views can be static or can contain dynamic data elements. Views can also contain other views in a nested fashion. + +Views are implemented as
elements within the HTML document structure. + +Views can be used to define overall page layouts by putting other Requests into a view. + +Other more advanced graphical elements can be created by combining views into a 'view group'. + +Views have layout style specifications for the elements contained within them. Absolute layout allows a WYSIWYG layout with precise pixel location. Linear layouts line things up either vertically or horizontally. Proportional layouts use percentages so that they scale and constraint layouts are similar but offer greater flexibility in controlling the expansion/compression of the elements in the display area. + +Views that have URIs attached to them are considered document level views and will be triggered when the browser makes a get request to the URI. + +TABLE elements can also be specified in a view. + +Javascript code can be attached to components within the view or to the view itself. Custom components can be built that plug into the layout tool environment and can be designed into the application environment with prebuilt behaviors. Complex display control can be constructed using these tools. + +\subsection{View Data Sources} + +Data is available to be displayed and represented that is only available when the views are rendered. Sources of this data are as follows: + +\begin{enumerate} + +\item Set variable performed in the view code or from a previously run process in the same transaction to name a piece of data for later use. + +\item CGI data received in the request as form-data is available to the request handler. Use the [:variable-name] syntax to ensure that CGI data is the source of the data. + +\item Session variables provide access to persistent storage that survives for the duration of the session. + +\item A data result table that was retrieved from an mySQL buffer. + +\end{enumerate} + +Standard variable syntax of just using variable-name will perform a search for a variable regardless of its type but prioritized by the following order: + + + + +\section{View Components} + +Views may utilize HTML constructs to assemble part of its implementation. The use of ,
, ,