Defined in file: hzDissemino.h
hdsApp: Dissemino webapp (web application) class. Of necessity, hdsApp is a large class because it contains everything the webapp will need, which is an extensive list. Note that hdsApp instances are created by calling hdsApp::GetInstance(), as the constructor is private.
This class employes the private sub-class _tagArg as follows:-
_tagArg
Constructors/Detructors
| hdsApp* | hdsApp | (void) | |
| hdsApp* | hdsApp | (hdsApp&) | |
| NULL-TYPE | hdsApp | (void) | Application logfile |
| void | ~hdsApp | (void) |
Public Methods:
| hzEcode | AddCIFunc | (hzEcode(*)(hzHttpEvent*) pFunc)hzString path, uint32_t access, HttpMethod eMethod, | Add a function that effects a Dissemino page to the application's resource map. In this case only a path is available and not a resource name so only the m_ResourcesPath map is aggregated. |
| hzEcode | AddUserType | (hzString& utname) | Reserve the user type name and set an access code mask for that user type. |
| void | AssignVisentIDs | (hzArray<hdsVE*>& listVE)uint32_t& flags, | As the assignment of positional identifiers to a VE is a recursive process, this function acts as the root. Returns: None |
| bool | AtPcEnt | (hzString& pcntEnt)hzChain::Iter& input, | Determine if the supplied chain iterator is at the start of a percent entity and if it is, populate the supplied string (arg 1) with the entity |
| hzEcode | CheckProject | (void) | Checks that all pages are refered to. Writes out synopsis of the application. Arguments: None |
| void | ConvertText | (hzChain& Z)hzHttpEvent* pE, | Process the supplied data (assumed to be text) by replacing any incident percent entities by thier 'here and now' values. The data is supplied as a chain which remains in situ and will be unchanged if there are no succesful percent entity conversions. Returns: None |
| hzString | ConvertText | (hzString& str)hzHttpEvent* pE, | Process the supplied data (assumed to be text) by replacing any incident percent entities by thier 'here and now' values. The data is supplied as a string which remains in situ and will be unchanged if there are no succesful percent entity conversions. Returns: None |
| hzEcode | CreateDefaultForm | (hzString& cname) | Create a form definition and form handler for the named data class. |
| hzEcode | ExportDefaultForm | (hzString& cname) | Export data classes found in the configs as XML fragments that define default forms and form-handlers. This facility is provided as a development aid in order to save time. The output is to file name "classforms.def" in the current directory which should always be the development config directory for the website. The facility is invoked by calling Dissemino with "-forms" supplied as an argument. Dissemino will load the configs, write the classforms.def file and then exit. There will be one form and one form-handler generated for each class found in the configs, including those for which form(s) currently exists. Forms in HTML cannot be nested so in cases where class members are composite (have a data type which is another class), the form produced will contain an extra button for each composite member. The class which a member has as its data type will have to have been declare beforehand (otherwise the configs cannot be read in), and this will have a form and form handler. The ... |
| hzEcode | ExportStrings | (void) | Export all strings for external language translation Arguments: None |
| hdsApp* | GetInstance | (hzLogger& pLog) | Create a hdsApp instance Pointer to the new Dissamino application |
| void | ImportStrings | (void) | |
| void | InPageQuery | (hzHttpEvent* pE) | Respond to an in-page query (Dissemino AJAX) An in-page query is an AJAX request to a URL of the form '/ck-repos.member.value' - to which the response is a blank page with a HTTP return code of either 200 (OK) or 404 (NOTFOUND). A code of 200 indicates that the repository exists, is populated and is of a class which possesses the named member. The purpose of an in-page query is to support form validation. Fields which must contain a unique value such as an email address or a username (a common requirement in site membership application/registration forms), can be validated by these AJAX calls. Returns: None |
| hzEcode | IndexPages | (void) | Go through all pages found in the config files and index them Arguments: None |
| hzEcode | InitApp | (hzDomain& domain)hzString& baseDir, hzString& rootFile, | Sets the application name, the domain and base directories for the Dissemino application. These are as per the following arguments:- |
| hzEcode | InitMailerAuth | (hzString& smtpAddr)hzString& smtpUser, hzString& smtpPass, | |
| hzEcode | InitMasterLogin | (hzString& masterPath)hzString& masterUser, hzString& masterPass, | |
| hzEcode | InitResources | (void) | Set up both config file and resouce database for the application. |
| bool | IsPcEnt | (hzString& pcntEnt)const char* input, | Determine if the supplied cstr is a percent entity and if it is, populate the supplied string with the entity |
| hzEcode | LoadPassives | (void) | Load all passive HTML files found in the document root (recurses to sub-dirs) Arguments: None |
| hzSysID | MakeCookie | (hzIpaddr& ipa)uint32_t eventNo, | HadronZoo::Dissemino cookies have names based on fixed names Make a unique cookie for your internet aplication |
| hzEcode | MakeNavbarJS | (hzChain& Z)hdsLang* pLang, uint32_t access, | Produce a JavaScript array for the purpose of populating a navbar (navigation drop-down menu). The elements comprise the level (of the item in the menu), the page title and the page url. This format is assumed by the standard script _dsmScript_navbar which converts the array into a visible navbar. For the navbar to appear in a page, both array and script must appear within the output HMLL for the page, either within a <script> tag OR as a referred resources within tags of the form <script src="">. This function is used by the hdsApp::SetupScripts initialization function to prepare several scripts ahead of their use in pages. There are efficiency savings in doing this but it is imperative the navbar must not contain links to pages the visitor is not permitted to access. To this end, hdsApp::SetupScripts calls this function is called once for access level PUBLIC, once for access level of ADMIN and once for each of the user classes. This produces several variant navbar scripts and the page generation process selects the script to include in the page according to the user status. |
| hzEcode | MakeNavtreeJS | (hzChain& Z)uint32_t access, | |
| void | MasterArticle | (hzHttpEvent* pE) | Serve an master article. These are articles in that a partial page is served by AJAX but they are an in-built feature of Dissemino rather than defined as a part of the application configs. At present the only example of AJAX in the master section is the Data Model Editing regime. Here, there is a host page and a navigation tree listing all data enums, classes and class members, and repositories in the current application data model. An article containing a form exists for each of the following:- 1) Addition of a new enum or displaying/editing an existing enum. The enum values are listed in a table with an blank row and an add button for adding new values. The values have a checkbox for setting them active/inactive and there is a checkbox for setting the enum as a whole to active/inactive. The URL of the blank article/form for adding a new enum is /master_dme_enum with no further arguments. This will be extended by -enum_name for an existing enum. 2) Addition of a new class or displaying/editing an existing class. The class members are listed in a table showing the data type and other parameters. The table cannot be edited in-situ. The class members, which can themselves be classes, are edited by clicking on the member name. The URL of the blank article/form for adding a new class is /master_dme_class and for an existing class this will be extended by -N where N is the class number. 3) Addition of a new class member or the editing of an existing one. This included the ability to set the member ative/inactive. The URL of the blank is /master_dme_mbr and for an existing member this will be extended by -N where N is the member number. Note it is not necessary to have a class id and a member id. 4) Addition of a new respository or the editing of an existing one. This must name a single host class. |
| hzEcode | PcEntConv | (hzAtom& atom)hzString& v, hzHttpEvent* pE, | Convert percent entities to set the type and value of the supplied atom. Here the percent entity is supplied in isolation. The ConvertText function (which calls this function), is used where percent entities can appear as part of a larger string (that is otherwise to be used verbatim). |
| hzEcode | PcEntScanChain | (hzString& err)hdsFormdef* pFormdef, hdbClass* pHost, hzChain& input, | Scans a chain (of HTML) looking for percent entities to test. If none found then the supplied text is automatically deemed valid. If there are percent entities, these are tested for valididity by calling PcEntTest(). If any of these are invalid or out of scope the supplied text is deemed invalid. |
| hzEcode | PcEntScanStr | (hzString& err)hdsFormdef* pFormdef, hdbClass* pHost, hzString& input, | Scans a string looking for percent entities to test. If none found then the supplied text is automatically deemed valid. If there are percent entities, these are tested for valididity by calling PcEntTest(). If any of these are invalid or out of scope the supplied string is deemed invalid. |
| hdbBasetype | PcEntTest | (hzString& err)hdsFormdef* pFormdef, hdbClass* pHost, hzString& pcntEnt, | Validate the supplied percent entity. The scope tests differ by percent entity class as follows:- X (%x) Standard system values: These are global so as long as the named entity exists it will be valid. U (%u) Standard user values: Must exist and be within a form accessible to logged in users. S (%s) User session variables: These are valid within any form as long as named variable has been created in an earlier <procdata> command. E (%e) Event values: These are tested against the fields known to exist in the supplied form. I (%i) In-situ values: Must be within a form and name members of the form's native data class. V (%v) Session object values: These are valid if the name members of a session object that an earlier <procdata> command has brought into focus. Returns The basetype if the entity is found and can be evaluated. BASTETYPE_UNDEF otherwise. |
| void | ProcForm | (hzHttpEvent* pE)hdsFormref* pFormref, hdsFormhdl* pFhdl, | Execute all commands specified within a form handler and formulate the HTTP response. This runs each command in the form-handler, in order of appearence in the configs. Form handlers are invoked on form submission and in all cases, there must be a full page HTTP response. Forms are protected by form-validation JavaScript by default, but this can be by-passed by robots and is anyway limited. The data can be nonsense but if the format is correct, it is likely to be passed on to the form-handler. Note that email validation can be inconclusive. Malformed email addresses are rejected in all cases, however other error conditions cannot always be detected. If the DNS is down, it will not be possible to determine if the domain name is invalid or has no destination mailservers. Even with the DNS up, the destination mailserver may be down, or it may reject the email for temporary reasons. The policy is to report invalid emails to the user, but only where they are proved invalid by means that are immeadiately to hand. In all other cases, emails that are not proved valid are assumed valid, so the rest of the form can be processed. While command outcomes are limited to either a fail, a success or a presumed success, remedial action for a failure will depend on the command. In cases where the original form can be modified to correct the error, the HTTP response should be to re-display the original form. Where the error cannot be corrected by the user the response should be to ask the user to try again later. The way this is handled is that all commands should be supplied with an error directive. At the end of the form-handler a <response> tag must be supplied to specify the HTTP response on success. The responses must be a full page, either an actual PAGE or a C-Interface FUNCTION that generates a page. The response cannot be an article (a partial page). Returns: None |
| hzTcpCode | ProcHTTP | (hzHttpEvent* pE) | Process all HTTP requests and form submissions. |
| hzEcode | ReadMicroservice | (hzXmlNode* pRoot) | Process configs for a single repository microservice. Microservices rest on hdsApp which is designed to accommodate Dissemino webapps. With microservices however, the configs are limited to specifying the data model. There are no pages or articles, and no forms or form handlers. Arguments: None |
| hzEcode | ReadWebapp | (hzXmlNode* pRoot) | Process a Dissemino webapp config XML document. This function is called once the XML document has been loaded, and the root node is found to be a <webappCfg> tag. Arguments: None |
| hzEcode | ReadWebappCfg | (hzString& cfgPath) | Load a webapp config file into an XML document, then call ReadWebapp() with the root node, which is expected to be a <webappCfg> tag. Arguments: None |
| hzEcode | ReloadConfig | (const char* cfgfile) | In the event of a config file being changed, this function allows the config to be reloaded, thereby changing the website content without a restart. The function is called once for each changed config file. |
| void | SendDocument | (hzHttpEvent* pE) | |
| void | SendErrorPage | (hzHttpEvent* pE)HttpRC rv, const char* func, const char* va_alist, | Returns: None |
| void | SendErrorPage | (hzHttpEvent* pE)HttpRC rv, const char* func, hzChain& error, | Returns: None |
| hzEcode | SetCookieName | (hzString& cookieBase) | Sets the application name and base directories for the Dissemino application. These are as per the following arguments:- |
| hzEcode | SetLoginAJAX | (hzString& cmd) | |
| hzEcode | SetLoginPost | (hzString& post)hzString& fail, hzString& auth, hzString& resume, | Add the login POST URL. This |
| hzEcode | SetStdTypeValidations | (void) | Attaches Validation JavaScript to the standard data types. For this to succeed, the standard data types have to be present in the ADP. This function must therefore, only be called after a call to m_ADP.InitStandard(). Execution is terminated if any of the standard types expected are missing. Arguments: None |
| hzEcode | SetupMasterMenu | (void) | Setup the webmaster menu as a tree of C-Interface articles. This creates the master page templates for viewing/managing the data model. Includes the forms and form handlers for creating/editing classes, class members and repositories. |
| hzEcode | SetupScripts | (void) | This is run as part of the hdsApp initislization sequence. It adds the navbar handler script and the user dependent navbar menu scripts. These are places in m_rawScripts (the unzipped versions) and m_zipScripts (the zipped versions). Note. As the navigation bar is multi-lingual, this function must be called after the language files have been imported. Arguments: None |
| void | Shutdown | (void) | Shutsdown Dissemino Application. Deallocates all allocated resources before desconstruction Arguments: None Returns: None |
| hzEcode | _SubscriberAuthenticate | (hzHttpEvent* pE) | Handle login submissions Note all user are authenticated against the subscriber repository |
| void | _assignveids_r | (hdsVE* pVE)uint32_t& flags, uint32_t& nId, | Recursive support function to non recursive AssignVEids() function This will assign numeric 'positional' identifiers to a VE according to incidence within a page, article or block Returns: None |
| hzEcode | _autoFormClass | (hzChain& Z)hdbClass* pClass, hzString strAuto, | |
| hzEcode | _autoFormRepos | (hdbObjRepos* pRepos)hzString strAuto, | |
| uint32_t | _calcAccessFlgs | (hzString& a) | Determine access flags on the basis of user. No user or a user of 'public' means in the case of a resource, that the resource will always be visible in the browser unless rendered invisible by other means. A user of 'any' means that the user has to be logged in but it does not in what capacity. Any other setting must nessesarily be a user type and in this case, only users logged in as that type would see the resource. If more than one type of user is to be authorized then this has to be stated as user="typeA|typeB" The display logic as applied to resources is always as follows:- - If the access value of (the resource) is 0 then show - If the access value is non-zero then the access value of the user must match on a bitwise AND To facilitate this public will produce an access value of 0, any (or all) an access value of 0x7fffffff and specific user type will each set one bit. |
| void | _doHead | (hzChain& Z)const char* cpPage, | Formulate a standard HTML header (the <head> tag) and agregate it to the supplied chain. The title is set to the supplied value and the header contains a link to the application's stylesheet. Returns: None |
| void | _doHeadR | (hzChain& Z)const char* cpPage, const char* cpUrl, int nDelay, | Formulate a standard HTML header as with _doHead() but with the addition of a <meta> refresh tag to direct the browser to another URL after a stated time interval. Returns: None |
| void | _exportStr | (hzChain& Z)hdsVE* pVE, uint32_t rid, | Now for each subtag, output first the pretext (part of this tag's content) and then call recursively on the subtag Returns: None |
| hzEcode | _loadInclFile | (hzString& dir)hzString& fname, | Read in an included config file on the condition that it either has no entry in the config repository, or has a later date than the config repository entry indicates. Once read in, the config repository is updated. Apply the same per-page logic as readProject() does to tags except that there will be no project wide info or further includes in an included file. |
| hzEcode | _readCSS | (hzXmlNode* pN) | Process the singleton <xstyle> tag. This tag is the same as a HTML style tag except that the style definitions can all be in the XML config file(s) instead of a .css file. The original plan was twofold; To ensure there was only one CSS resource for the website instead of many, thereby reducing demand on the server AND at some future point to manage the styles so that warnings could be generated if a style was redundant or did not exist. This latter objective has yet to be implimented, largely because CSS has undergone significant evolution since the <xstyle> tag was concocted and style management does not have a high priority. |
| hdsVE* | _readChartBar | (hzXmlNode* pN) | Read in parameters for displaying a standard (bar or line) chart (graph) Pointer to the new standard chart as a visible entity NULL If the any configuration errors occur |
| hdsVE* | _readChartPie | (hzXmlNode* pN) | Read in configs for a pie chart. The current XML node is assumed to be at an <xchartPie> tag Pointer to the new pie chart as a visible entity NULL If the any configuration errors occur |
| hdsVE* | _readChartStd | (hzXmlNode* pN) | Read in parameters for displaying a standard (bar or line) chart (graph) Pointer to the new standard chart as a visible entity NULL If the any configuration errors occur |
| hzEcode | _readClass | (hzXmlNode* pN) | Database and Data Class Config Read Functions Process a <class> tag to define a data class. The class may then be used to initialize a repository, or used as a member of another class which may then be used to initialize a repository. |
| hzEcode | _readColumn | (hdsCol& col)hzXmlNode* pN, | Obtain the table columns |
| hzEcode | _readDataEnum | (hzXmlNode* pN) | Process the <enum> tag to establish a new enum (enumerated data type). Enums are internally manifest as hdbEnum instances. Externally enum values can be manifest as set of check boxes or radio buttons, or as HTML selectors. The <enum> tag has attributes of name, xple and var. As enums are data types, the enum name must be unique among all data types. The xple attribute indicates if multiple options can be selected. For the purpose of clarity, neither the <selector> tag nor the hbdSelector instance it specifies, are the same thing as a HTML <select> tag. The latter can appear in HTML output in respect of the hdbSlector, only when the HTML for a form having a field whose data type is the hdbSelctor, is produced. It should be noted, that the hdbEnum may not necessarily manifest as a HTML <select> tag at all. It could manifest as a set of check boxes or as a set of radio buttons. Because in processing the <selector> tag, we are only defining the set of strings, we cannot say at this stage, what the default should be. That has to be done in the configs for the field within the form. Likewise the option for multiple selection is not vested with the hdbEnum. That is a matter for any data class member that uses the hdbEnum as it type. items may be selected from it when it is manifest in a form. The only thing that is determined here is whether the enum is fixed once loaded with values - or can have values added during runtime. |
| hdsVE* | _readDiagram | (hzXmlNode* pN) | Read in diagram components. <xdiagram id="mydiagram" header="flowchart"> <stadium top="20" bot="70" lft="50" rht="150" text="Start"/> <arrow from="70,100" to"120,100" width="2" head="10" color="0"/> <diamond top="120" bot="220" lft="50" rht="150" text="Are we ready?"/> <arrow from="170,150" to"70,100" width="2" head="10" color="0" text="N"/> <arrow from="220,100" to"270,100" width="2" head="10" color="0" text="Y"/> <stadium top="270" bot="320" lft="50" rht="150" text="Go!"/> </xdiagram> Pointer to diagram visual entity |
| hdsVE* | _readDirlist | (hzXmlNode* pN)hdsResource* pPage, | Read the <xdirlist> tag. The <xdirlist> tag translates a directory listing into a HTML table. <xdirlist> is an active tag and so any page or article containing an <xdirlist> is automatically deemed active and will always be generated. <xdirlist> has a compulsory attribute of (directory) path, and optional attributes to specify filtering criteria and sort order, as well the CSS class, number of rows, row height and table width. The resulting HTML table automatically displays a scroll bar on the right, if there are too many directory entries to fit the stated display area. Display colunms are added with the <xcol> subtag. The <ifnone> subtag specifies what HTML is be produced in the event of no entries found. There can also be <header> and <footer> subtags. Pointer to diagram visual entity |
| hzEcode | _readExec | (hzXmlNode* pN)hzList<hdsExec*>& execList, hdsPage* pPage, hdsFormhdl* pFhdl, | Read in a set of one or more Dissemino exec commands in a <procdata> tag. |
| hdsVE* | _readField | (hzXmlNode* pN)hdsFormdef* pFormdef, | Process an <xfield> tag within a <xformDef> tag, thereby adding a field (hdsField) to a HTML form (hdsFormdef). Fields within forms must relate to a data object member, OR an independent variable. The <xfield> tag must identify the member or variable concerned, then it must supply the necessary parameters for a viable HTML <input> tag. These parameters can be supplied directly, or as a predefined fldspec (field specification). Pointer to the visible entity NULL if a syntax error occurs |
| hzEcode | _readFixDir | (hzXmlNode* pN) | Read in an <xfixdir> tag and place the content as a fixed file in the app's m_Fixed map of URLs to fixed HTML or text content |
| hzEcode | _readFixFile | (hzXmlNode* pN) | Read in an <xfixfile> tag and place the content as a fixed file in the app's m_Fixed map of URLs to fixed HTML or text content |
| hzEcode | _readFldspec | (hzXmlNode* pN) | Database and Data Class Config Read Functions Create a new field specification in accordance with the <fldspec> tag. The field specification defines what is needed to present the field as part of a HTML form. Note that a field specification can be supplied as an attribute to the <member> tag used to define data class members within a <class> tag, exept where the intended member is itself a class. This is possible because the field specification contains where applicable, the fundamental data type of the data enum (hdbEnum instance). This practice is recommended as a convienient short form and because it facilitates the generation of default forms and form-handlers when Dissemino is run with the -forms option. |
| hdsVE* | _readFlowchart | (hzXmlNode* pN) | Read in flowchart components. Pointer to diagram visual entity |
| hdsVE* | _readFormBut | (hzXmlNode* pN)hdsFormdef* pFormdef, hdsFormref* pFormref, | Support function to hdsApp::_readFormDef called via hdsApp::_readTag, to add an action to the supplied form definition. |
| hzEcode | _readFormDef | (hzXmlNode* pN) | Process an <xformDef> tag to define a form (create a hdsFormdef instance), in the INDEPENDENT case where the <xformDef> tag lays outside any page or article definition. The expectation is that the defined form will later be referred to by means of an <xformRef> tag within one or more pages or articles. In the independent case <xformDef> has three attributes of 'name' which names the form, 'class' which sets the host data class, and 'action' which names a yet to be defined form handler. The first two are compulsory but if the action is not set in the <xformDef> tag itself, it must be set for each active button in the form. Both the form name and form handler name(s) are required to be unique across the entire configs. The following occurs within this function: 1) A new form definition is created placed in hdsApp::m_FormDefs. This map is purely to ensure forms are given unique names. 2) For each form action, a form handler is named and a URL supplied. The form handler name is added to hdsApp::m_FormHdl, ensuring it is unique. No actual form handler is created however. This must await processing of a later <xformHdl> tag. In the meantime the form handler pointer in the entry in hdsApp::m_FormHdl, is NULL. If <xformDef> processes successfully, a form definition is created and entered into the hdsApp map m_FormDefs, thereby facilitation form referencing. |
| hdsFormref* | _readFormDef | (hzXmlNode* pN)hdsResource* pLR, | Process an <xformDef> tag occuring WITHIN a page or article definition. This produces both a form definition (hdsFormdef) and a form reference (hdsFormref), as described in the section on Forms in the Library Overview. Accordingly, in addition to the three attributes necessary for the form definition, the submission URL needed for the form reference For the form definition there are three attributes of 'name' which names the form, 'class' which sets the host data class, and 'action' which names a yet to be defined form handler. The first two are compulsory but if the action is not set in the <xformDef> tag itself, it must be set for each active button in the form. Both the form definition name and form handler name(s) are required to be unique across the entire configs. For the form reference an additional attribute of 'url' is needed to supply the submission URL. The following occurs within this function: 1) A new form definition is created placed in hdsApp::m_FormDefs. This map is purely to ensure forms are given unique names. 2) A new form reference is created and will point to the form definition. A pointer to this is returned if no errors occur. 3) For each form action, a form handler is named and a URL supplied. The form handler name is added to hdsApp::m_FormHdl, ensuring it is unique. No actual form handler is created however. This must await processing of a <xformHdl> tag. In the meantime the form handler pointer in the entry in hdsApp::m_FormHdl, is NULL. 4) The URL and the form handler name are added to hdsApp::m_FormUrl2Hdl 5) Each form action URL, together with the form reference, is added to both hdsApp::m_FormUrl2Ref and hdsApp::m_FormRef2Url Pointer to the form reference NULL if a syntax error occurs |
| hzEcode | _readFormHdl | (hzXmlNode* pN) | Process a <xformHdl> tag to create a hdsFormhdl (form handler) instance. Form handlers are always invoked upon form submissions to process the submitted data and formulate a HTML response. The configs for the form handler set out a series of processing instructions. Each of these may contain a response directive in the event of failure. There is also a response directive for failure of the series as a whole and another for success. To see the latter, every instruction in the series must succeed. |
| hdsFormref* | _readFormRef | (hzXmlNode* pN)hdsResource* pLR, | Process a <xformRef> tag. The <xformRef> tag imports a form as a complete, self contained visual entity into a page or article. Accordingly, the tag is legal only within the definitions of a page or article or within the definition of an entity that can only be a part of a page or article such as an include block. As the form is self contained, <xformRef> has no legal sub-tags. The form being imported must have been defined previously and in the project space, outside the definitions of any page or article. The following occurs within this function: 1) A new form reference is created and will point to the named form definition. A pointer to this is returned if no errors occur. 2) For each form action listed in the form definition, a URL supplied. The URL and the form handler name are added to hdsApp::m_FormUrl2Hdl 3) Each form action URL, together with the form reference, is added to both hdsApp::m_FormUrl2Ref and hdsApp::m_FormRef2Url Pointer to the form NULL if a syntax error occurs |
| hdsVE* | _readFunc | (hzXmlNode* pN)uint32_t nLevel, | |
| hzEcode | _readInclFile | (hzXmlNode* pN) | Parse the content of an included config file, named in an <includeCfg> tag. Included config files allow application configs to be broken down into more managable sections. The set of allowed tags in an included config file, and the rules that apply to them, are the same as in the root config file - except for the <includeCfg> tag itself. This is only allowed in the root config file, limiting included config files to a single level. As the same set of tags and rules apply, the core of this function is the basically same as that of hdsApp::_readProject() which reads the root config. When a <includeCfg> tag is encountered in the root config file, the hdsApp::_loadInclFile() function is first called to load the config to be included into a separate hzDocXml instance. Then hdsApp::_loadInclFile() calls this function. As the included config is an XML document it must have a root node. In the webapp root config file this is always <webappCfg> which sets the webapp core parameters. However within an included config file, the root node can be anything as long as it exists and is properly closed. It is otherwise redundant and is ignored. |
| hzEcode | _readInclude | (hzXmlNode* pN)hdsVE* parent, uint32_t nLevel, | The <xinclude> tag describes a block of HTML which can subsequently be included in webpages and form responses. <xinclude> is a legal subtag of <webappCfg> only. It may not appear in a page definition. Within an <xpage> tag, <xblock name="blockname"/> names the block of tags to be included. Note that virtually all tags that are legal within an <xpage> tag, are also legal within an <xinclude> tag. This function is thus very similar to the _readPage() function. |
| hzEcode | _readInitstate | (hzXmlNode* pN) | |
| hdsFormref* | _readLoginForm | (hzXmlNode* pN)hdsPage* pPage, | |
| hzEcode | _readLogout | (hzXmlNode* pN) | When a user logs out, they cannot remain on a page that requires a login to view. It is essential the user lands on a publicly available page, such as the home page or the login page. |
| hzEcode | _readMember | (hdbClass* pClass)hzXmlNode* pN, | Database and Data Class Config Read Functions Process a <member> tag to read in details of a class member. This will be as part of reading in a data or user class definition under either a <class> or <user> tag so this function must only ever be called by _readClass() or _readUser(). The <member> tag has the necessary attributes to define a data class member, namely the name, data type and population constraints. In addition and counter to doctrine, the <member> tag has attributes that describe how the member is to be displayed in a HTML form. These are used for generating the data class default form. The standard practice is to supply the HTML parameters as a predefined fldspec (field specification). Note that fldspec includes the data type because the _readFldspec function needs it to check that it is compatible to the HTML type. Because fldspec includes the data type, use of fldspec precludes use of the type attribute in the <member> tag. NOTE that if a member has a 'class' attribute, this must name a predefined data class. The member is then defined as having the named class as its data type. |
| hzEcode | _readMiscDir | (hzXmlNode* pN) | Read in an <xfixdir> tag and place the content as a fixed file in the app's m_Fixed map of URLs to fixed HTML or text content |
| hzEcode | _readNav | (hzXmlNode* pN) | Read in <navigation> tag and its set of <subject> tags. These set the order for the subject headings for a navbar pull down menu |
| hzEcode | _readPage | (hzXmlNode* pN) | Process an <xpage> tag (a web page definition). (with or without forms). All tags begining with an 'x' are Dissemino active tags (eg xform and xfield) and these tags produce the associated Dissemino classes. All other tags must be valid HTML tags and are there only for presentation. Since the config files are XML a successful load means all the tags are balanced. This means we only need to mirror the structure of XML tags to visual entities. |
| hzEcode | _readPageBody | (hdsPage* pPage)hzXmlNode* pN, | Process an <xbody> tag to read a page body. The page body can contain a mixture of Dissemino and HTML tags. |
| hzEcode | _readRepos | (hzXmlNode* pN) | Database and Data Class Config Read Functions Process the <repos> tag which to construct a repository. |
| hzEcode | _readResponse | (hzXmlNode* pN)hdsFormhdl* pFhdl, hzString& pageGoto, hdsResource** pPageGoto, | Read in all tags for a page (with or without forms). All tags begining with an 'x' are mkapp active tags (eg xform and xfield) and these tags produce the associated mkapp classes. All other tags must be valid HTML tags and are there only for presentation. Since the config files are XML a successful load means all the tags are balenced. This means we only need to mirror the structure of XML tags to visual entities. |
| hzEcode | _readRgxType | (hzXmlNode* pN) | The <rgxtype> tag defines an APPDEF data type, and add it to the available data types for HDB use. An APPDEF data type is a simple regular expression that constrains string values to a particular format, that is of meaning to the application. It is acknowledged that the treatment of regular expressions by the HDB, is not comprehensive. The <rgxtype> attributes name the datatype, set the maximum length, and set out the regex. |
| hzEcode | _readScript | (hzXmlNode* pN) | Read in a JaveScript from an <xscript> tag and place the script in m_rawScripts (if it does not already exist) |
| hzEcode | _readShapes | (hzXmlNode* pN)hdsDiagram* pDiag, | |
| hzEcode | _readSiteLangs | (hzXmlNode* pN) | Read in a site language directive. This comprises the whole set of languages the site will support. The directive starts with a <siteLangusges> tag and names each language with a <language> tag. These in turn comprise the language code, the image for the display flag and the language name |
| hzEcode | _readStdLogin | (hzXmlNode* pN) | Read in the standard login declaration which defines the URLs for the following:- - the URL for login form submissions - the URL to go to in the event of authentication failure - the URL to go to in the event of authentication success - the URL to go to upon session resumption |
| hdsVE* | _readTable | (hzXmlNode* pN)hdsResource* pPage, | Read the <xtable> tag. The <xtable> tag defines how a list of items is to be compiled and presented as a HTML table. Currently the items can only be data objects selected from a repository. However the intention is to extend the remit of <xtable> to include other items. Directory entries will not be included however, as these would be handled by the <xdirlist> tag. In its present form, the <xtable> tag has two compulsory attributes to specify the respository and the filtering criteria. It has other non-compulsory attributes to specify CSS class, the number of rows, row height and overall width. The HTML table produced will automatically display a scroll bar on the right hand side if there are too many directory entries to fit the stated display area. The colunms to be displayed are all standard directory entry properties and are specified with the <xcol> sub-tag. The <ifnone> sub-tag specifies what HTML is be produced in the event of no entries found. There can also be <header> and <footer> sub-tags to define what HTML goes above and below the directory entry table. Pointer to diagram visual entity |
| hdsVE* | _readTag | (hdsApp::_tagArg* tga)hzXmlNode* pN, uint32_t& bScrFlags, hdsVE* parent, uint32_t level, | Support function to the following:- 1) _readInclude() which reads the <xinclude> tag to create blocks of tags that can be included in pages and articles. 2) _readDirlist() which reads the <xdirlist> tag to define how a listing of directory entries should be presented. 3) _readTable() which reads the <xtable> tag to define how aselection of objects in a repository should be presented. 5) _readFormDef() which reads the <xformDef> tag to create a form definition. 5) _readPage() which defines a page 6) _readArticle() which defines an article All the above functions expect to process a mix of Dissemino and supportive HTML tags. Certain Dissemino tags are of particular importance to particular functions but since the tags are mixed, these are commonly parented by ordinary HTML tags. This means a recursive support function of some form is required to process the mix of tags on behalf of the above functions. Furthermore, many of the Dissemino tags are also only supportive and their use is widely permitted. This means the range of tags a recursive support functions would have to handle, would be extensive. This would mean the recursive support functions would themselves be extensive. In some respects, there would be greater clarity if each of the six functions in the above list had their own recursive support function. If this were the approach however, all the recursive support functions would be extensive and similar to each other, thereby undermining clarity. This function was written to merge recursive tag processing in order to avoid such verbosity. Note the recusion is limited in the case of particular tags. This is where the function called to process the tag, is expected to process the entire set of sub-tags and calls _readTag() in order to acheive this. For example, an <xformDef> tag results in a call to _readFormDef() but before this, a flag is set to block recursion of <xformDef> sub-tags within this invokation of this function. The _readFormDef() function will separately invoke this function to process all the sub-tags and return having completed a form definition. It would not make sense for the same sub-tags to be processed again. Pointer to diagram visual entity |
| hzEcode | _readText | (hdsText& tx)hzXmlNode* pN, | Read a HTML canvas text entity |
| hzEcode | _readUser | (hzXmlNode* pN) | Database and Data Class Config Read Functions A user class is a special case of data class, which defines data class members for a particular type of application user. In general, creation of a data class is a separate act from creating a repository. All classes declared should be used to create repositories otherwise there is no point defining them, but a class can be used to form a member of another class. This is not the case with a user class. For each <user> tag in the config files, there will be exactly one user class and one user repository and the repository will bear the same name as the class. It is not possible to use a user class as a member of another class. This function adds the user class to m_ADP.mapClasses and adds the user repository to m_ADP.mapRepositories. The user repository must be cached so storage method is not an attribute of the <user> tag as it is with <repos>. The user class must also name exactly one member to serve as the primary unique identifier (username). This is specified as an attribute of <user> namely 'primeKey'. |
| hdsVE* | _readXhide | (hzXmlNode* pN)hdsFormdef* pForm, | Process an <xhide> tag. This tag may only exist within an <xformDef> tag and has two attributes, 'name' and 'value'. Its effect is to insert a hidden feild into the output HTML of the form. The latter attribute is commonly a percent entity. The <xhide> tag is sometimes used in Dissemino applications to give a path back to some starting point. This could be after the user either completes or aborts, a series of one or more forms, or it could be to 'rescue' the user after a timeout. One example would be where a user is on a page they wish to comment on but to submit a comment they need to be logged in. They have either forgotton to log in or have been timed out. The login is available from the pull-down menu. By using such as <xhide name="lastpage" value="%x:referer;"> as a sub-tag of <xformDef> in the login page, the login form's 'Log-In' button can take the user back to the page of interest using the percent entity %e:lastpage; Hidden fields are notable because they have null field specifications. Only the m_Varname and m_Source members have values. Pointer to the visible entity NULL if a syntax error occurs |
| hdsVE* | _readXtreeCtl | (hzXmlNode* pN) | Process an <xtreeCtl> tag, which controls navtree manifestation. <xtreeCtl> should appear only within the page that hosts the navtree. The <xtreeCtl> tag has the following attributes:- group Name of group. This is compulsory and must name an existing article group, i.e. the group must be defined in the configs prior to use of the <xtreeCtl> tag. article The initial display article for the host page. show Display directive. This is compulsory and must have a value of 'title', 'content' or 'navtree'. If show is not 'navtree' the article attribute is compulsory. Pointer to visible entity |
| hzEcode | _readXtreeDcl | (hzXmlNode* pN)hdsPage* pPage, | Process an <xtreeDcl> tag to declare a hdsNavtree instance. Note that an <xtreeDcl> tag appearing OUTSIDE the scope of an <xpage> tag declares a public navtree (that can be referenced by multiple pages), while an <xtreeDcl> tag WITHIN an <xpage> declares a private tree (may only be used within the page). |
| hzEcode | _readXtreeItem | (hzXmlNode* pN)hdsNavtree* pAG, | Process an <xtreeItem> tag to add an article (tree item) to an article group (navtree) Each article must have a title (what the user sees), a URL for an AJAX GET, a node identifier (unique within the article group), and a parent node identifier (to facilitate article hierarchy within the group. can be effected. Article content is supplied as the <xtreeItem> content and the parameters given in attributes as follows:- 1) parent Parent node id. This will be null if the item(s) to be added are to be added directly to the root. 2) id This is name that will also be used as URL. It has to be unique. 3) link True/false. If true the added item will have a link in the resultant navigation tree. 4) title The title that will appear as the selectable item name in the navigation tree. |
Overloaded operators:
| hdsApp& | operator= | (hdsApp&) |
Member Variables:
| hdbADP | m_ADP | Application delta profile | |
| hzString | m_AllHits | The all hits repository name | |
| hzString | m_Appname | Name of project | |
| hzMapS<hzString,hdsNavtree*> | m_ArticleGroups | All article trees. If the tree pointer is NULL the tree will be bound to the user session. hzMapS <hzString,hzMD5> m_ResourcesMD5 ; // Path to page/article MD5 (temporary map used during app init) | |
| hzString | m_BaseDir | The base dir | |
| hzSet<hzString> | m_CfgEdits | All known config files under edit | |
| hzString | m_Configdir | Base directory for config files | |
| hzPMapS<hzString,uint32_t> | m_Configs | Persistent 1:1 map of all config files to their epoch dates | |
| hzString | m_CookieName | Name of cookie "_hz_" + adaption of domain name | |
| hdsNavtree | m_DataModel | Admin navtree (for showing interalia, application data model) | |
| hzString | m_Datadir | Base directory for data files | |
| hzString | m_DefaultLang | Default language (en-US unless otherwise specified in a <siteLanguages> tag) | |
| hzString | m_Docroot | Base directory for miscellaneous items | |
| hzDomain | m_Domain | The URL base string (eg www.mydomain.com) | |
| hzArray<hzString> | m_ExecParams | Exec parameters | |
| hzMapS<hzString,hdsFldspec> | m_Fldspecs | All variables definitions | |
| hzMapS<hzString,hdsFormdef*> | m_FormDefs | All known form definitions by form definition name | |
| hzMapS<hzString,hdsFormhdl*> | m_FormHdls | All known form handlers by name | |
| hzMapM<hdsFormref*,hzString> | m_FormRef2Url | Translates form references to form action URLs (used by hdsButton::Generate()) | |
| hzMapS<hzString,hzString> | m_FormUrl2Hdl | Translates form action URLs to form handlers (used to invoke form handlers) | |
| hzMapS<hzString,hdsFormref*> | m_FormUrl2Ref | Translates form action URLs to form references (used to obtain form handler op context) | |
| hzString | m_Images | Base directory for images | |
| hzMapS<hzString,hdsBlock*> | m_Includes | All known include blocks | |
| hzString | m_KeyPrivate | Recaptcha private key | |
| hzString | m_KeyPublic | Recaptcha public key | |
| hzMapS<hzString,hdsLang*> | m_Languages | All supported languages | |
| uint32_t | m_LastCfgEpoch | Last recorded epoch time of config directory (aux thread in Dissemino uses this to detect updates | |
| hzSet<hzString> | m_Links | All links to other pages | |
| hzString | m_LoginAJAX | The URL to which AJAX login form submissions must be posted | |
| hzString | m_LoginAuth | The URL the user will be directed to in event of successful authentication | |
| hzString | m_LoginFail | The URL the user will be directed to in event of username/password mismatch | |
| hzString | m_LoginPost | The URL to which login form submissions must be posted | |
| hzString | m_LoginResume | The URL the user will be directed to in event of successful session resumption | |
| hzString | m_LogoutDest | The logout destination page | |
| hzString | m_LogoutURL | The logout URL | |
| hzString | m_Logroot | Base directory for log files | |
| hdsPage* | m_MasterLogin | Admin page | |
| hdsPage* | m_MasterPage | Admin page | |
| hzString | m_MasterPass | Admin password | |
| hzString | m_MasterPath | Admin entry URL | |
| hzString | m_MasterUser | Admin username | |
| hzMapS<hzString,hzDirent> | m_Misc | Miscellaneous editable files | |
| uint16_t | m_OpFlags | DS_APP series flags | |
| hdbIndexText | m_PageIndex | The index of words/documents | |
| hzList<hzPair> | m_Passives | List of passive file directives | |
| hzString | m_Recaptcha | Google recaptcha key | |
| hzMapS<hzString,hdsResource*> | m_ResourcesName | All known pages by name | |
| hzMapS<hzString,hdsResource*> | m_ResourcesPath | All known pages by path | |
| hzMapS<hzString,hdsPage*> | m_Responses | All known form response and error pages by name | |
| hzString | m_Robot | The robot.txt response | |
| hzString | m_RootFile | The root of the application configs | |
| hzMapS<hzString,hzString> | m_SObj2Class | Map of all known user session or independent single object container keys - to class name | |
| hzString | m_SSL_Cert | SSL Certificate | |
| hzString | m_SSL_CertCA | SSL Certificate Authority | |
| hzString | m_SSL_PvtKey | SSL Private key | |
| hzMapS<hzSysID,hdsInfo*> | m_SessCookie | Session cookies by id | |
| hzString | m_SmtpAddr | Email address for outgoing messages, e.g. info@domain | |
| hzString | m_SmtpPass | Password for local email server | |
| hzString | m_SmtpUser | Username for local email server | |
| hzSet<hzString> | m_Styles | All CSS classes | |
| hzString | m_Sysimg | Base directory for system images | |
| hzLookup<uint32_t> | m_UserAgents | Collection of all encountered user agents | |
| hzMapS<hzString,uint32_t> | m_UserTypes | All known types of users vs access flags | |
| hzString | m_UsernameFld | Name of the username field (eg 'username' or 'email'). This will be looked for in the login inputs. | |
| hzString | m_UserpassFld | Name of the password field (usually 'password'). This will be looked for in the login form inputs | |
| hzMapM<uint32_t,hzPair> | m_VE_attrs | Attributes for the visual entitiies | |
| hzMapS<hzIpaddr,hdsProfile*> | m_Visitors | IP addresses of clients | |
| hzArray<hdsVE*> | m_arrVEs | All known visual entitiies | |
| hzChain | m_cfgErr | Written to by config read functions associated with key resources | |
| hzList<hzString> | m_lstPgSubjects | Set of page subjects | |
| hzMapM<hzString,hdsPage*> | m_mapSubj2Res | Map of subjects to pages of the subject | |
| uint32_t | m_nLoadComplete | Set once load complete (so any read config functions tolerate duplicate resources) | |
| uint16_t | m_nPortSSL | HTTPS Port uint16_t m_AppID ; // Application ID as assigned by Dissemino | |
| uint16_t | m_nPortSTD | HTTP Port | |
| hzString | m_namCSS | The stylesheet name | |
| hdbObject | m_objResource | Single object container for resource data objects | |
| hdbClass* | m_pClass_CfgFile | Data class for the database of config files | |
| hdbClass* | m_pClass_Resource | Data class for the resorces database | |
| hdsLang* | m_pDfltLang | Default language | |
| hzLogger* | m_pLog | Logger | |
| hdbMember* | m_pMbr_CfgFile_DATE | Config file last known date | |
| hdbMember* | m_pMbr_CfgFile_PATH | Resource URL | |
| hdbMember* | m_pMbr_Resource_DATE | Resource date | |
| hdbMember* | m_pMbr_Resource_HTM | Resource HTML (pro-forma) | |
| hdbMember* | m_pMbr_Resource_MD5 | Resource MD% | |
| hdbMember* | m_pMbr_Resource_PATH | Resource URL | |
| hdbMember* | m_pMbr_Resource_XML | Resource XML (from configs) | |
| hdbMember* | m_pMbr_Resource_Zip | Zipped HTML (if page is inactive) | |
| hdbObjRepos* | m_pRepos_CfgFile | Config file repository | |
| hdbObjRepos* | m_pRepos_Resource | Resource repository | |
| hdbBinRepos* | m_pStore_Resource | Binary repository for XML, post-genration HTML (zipped & raw) | |
| hzLookup<hzString> | m_rawScripts | Scripts | |
| hzChain | m_rawSiteguide | The siteguide.txt (zipped) | |
| hzChain | m_rawSitemapTxt | The sitemap.txt (unzipped) | |
| hzChain | m_rawSitemapXml | The sitemap.xml (unzipped) | |
| hzSet<hzString> | m_setPgSubjects | Set of page subjects | |
| hzMapS<hzString,hdbBasetype> | m_tmpVarsSess | Temp map for percent entity validation | |
| hzChain | m_txtCSS | The stylesheet content (unzipped) | |
| hzVect<hdsPage*> | m_vecPages | All known pages by name | |
| hzChain | m_zipCSS | The stylesheet content (zipped) | |
| hzLookup<hzString> | m_zipScripts | Scripts zipped | |
| hzChain | m_zipSiteguide | The siteguide.xml (zipped) | |
| hzChain | m_zipSitemapTxt | The sitemap.txt (zipped) | |
| hzChain | m_zipSitemapXml | The sitemap.xml (zipped) |