Skip to content
Browse files

Feature Upgrade/Bug Fix

The following changes were made:
1.) Added basic XML validation to the uploads page, to help ensure file compatability.
2.) Simplified the install script, allowing only a single chatbot to be added during the install process.
3.) Modified the Help page for the install script to reflect the change in the form mentioned above.
4.) Added a Troubleshooting section to the install script's Help page, just in case something goes haywire.

Signed-off-by: Dave Morton <dmorton@geekcavecreations.com>
  • Loading branch information...
1 parent 7eaf9b6 commit cb4aef6fe4cc908369d23317fe0ac9c5de05eff9 @Dave-Morton Dave-Morton committed May 5, 2012
Showing with 667 additions and 62 deletions.
  1. +47 −0 admin/upload.php
  2. +540 −0 config/AIML.xsd
  3. +32 −45 install/config.tpl.htm
  4. +48 −17 install/help.tpl.htm
View
47 admin/upload.php
@@ -9,6 +9,7 @@
// upload.php
ini_set('memory_limit','128M');
ini_set('max_execution_time','0');
+ libxml_use_internal_errors(true);
$file = (array_key_exists('aimlfile', $_FILES)) ? processUpload() : '';
$msg = parseAIML($file);
@@ -106,7 +107,33 @@ function parseAIML ($file) {
$sql_start = "insert into `aiml` (`id`, `bot_id`, `aiml`, `pattern`, `thatpattern`, `template`, `topic`, `filename`, `php_code`) values\n";
$sql = $sql_start;
$sql_template = "(NULL, $bot_id, '[aiml_add]', '[pattern]', '[that]', '[template]', '[topic]', '$fileName', ''),\n";
+ # Validate the incoming document
+/*
+$xml = new DOMDocument();
+$xml->load('./lures.xml');
+*/
$aimlFile = file_get_contents($file);
+ $validRootTag = '<aiml version="1.0.1" xmlns="http://alicebot.org/2001/AIML-1.0.1">';
+ $curRootTagStart = stripos($aimlFile,'<aiml',0);
+ $curRootTagEnd = strpos($aimlFile,'>', $curRootTagStart) + 1;
+ $curRootTagLen = $curRootTagEnd - $curRootTagStart;
+ $curRootTag = substr($aimlFile, $curRootTagStart, $curRootTagLen);
+ if ($curRootTag !== $validRootTag) $aimlFile = str_ireplace($curRootTag, $validRootTag, $aimlFile);
+ #die("<pre>$aimlFile</pre>\n");
+ $validate = new DOMDocument();
+ $validate->loadXML($aimlFile);
+ $validate->preserveWhiteSpace = false;
+ $validate->formatOutput = true;
+ if (!$validate->schemaValidate('./aiml.xsd')) {
+ $msg = "Cannot parse file $file! Please note errors that follow:\n";
+
+ $errors = libxml_get_errors();
+ foreach ($errors as $error) {
+ $msg .= libxml_display_error($error);
+ }
+ libxml_clear_errors();
+ return $msg;
+ }
$aiml = new SimpleXMLElement($aimlFile);
$rowCount = 0;
if (!empty($aiml->topic)) {
@@ -226,6 +253,26 @@ function getAIML_List() {
return $out;
}
+ function libxml_display_error($error) {
+ $out = "<br/>\n";
+ switch ($error->level) {
+ case LIBXML_ERR_WARNING:
+ $out .= "<b>Warning $error->code</b>: ";
+ break;
+ case LIBXML_ERR_ERROR:
+ $out .= "<b>Error $error->code</b>: ";
+ break;
+ case LIBXML_ERR_FATAL:
+ $out .= "<b>Fatal Error $error->code</b>: ";
+ break;
+ }
+ $out .= trim($error->message);
+ if ($error->file) {
+ $out .= " in <b>$error->file</b>";
+ }
+ $out .= " on line <b>$error->line</b>\n";
+ return $out;
+ }
?>
View
540 config/AIML.xsd
@@ -0,0 +1,540 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns="http://alicebot.org/2001/AIML-1.0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sch="http://www.ascc.net/xml/schematron"
+ targetNamespace="http://alicebot.org/2001/AIML-1.0.1" elementFormDefault="qualified"
+ attributeFormDefault="unqualified" version="1.0" xml:lang="EN">
+ <xs:element name="aiml">
+ <xs:annotation>
+ <xs:documentation>An AIML object is represented by an aiml element in an XML document.</xs:documentation>
+ <xs:appinfo>
+ <sch:title>Schematron validation</sch:title>
+ <sch:ns prefix="aiml" uri="http://alicebot.org/2001/AIML-1.0.1"/>
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="1" maxOccurs="unbounded">
+ <xs:element name="topic">
+ <xs:complexType>
+ <xs:annotation>
+ <xs:documentation>A topic is an optional top-level element that contains
+ category elements. A topic element has a required name attribute
+ that must contain a simple pattern expression. A topic element may
+ contain one or more category elements.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence maxOccurs="unbounded">
+ <xs:element name="category" type="Category"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="SimplePatternExpression" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="category" type="Category"/>
+ </xs:choice>
+ <xs:attribute name="version" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="1.0.1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="Category">
+ <xs:annotation>
+ <xs:documentation>A category is a top-level (or second-level, if contained within a
+ topic) element that contains exactly one pattern and exactly one template. A
+ category does not have any attributes. All category elements that do not occur as
+ children of an explicit topic element must be assumed by the AIML interpreter to
+ occur as children of an "implied" topic whose name attribute has the value * (single
+ asterisk wildcard).</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="pattern" type="MixedPatternExpression">
+ <xs:annotation>
+ <xs:documentation>A pattern is an element whose content is a mixed pattern
+ expression. Exactly one pattern must appear in each category. The pattern
+ must always be the first child element of the category. A pattern does not
+ have any attributes. The contents of the pattern are appended to the full
+ match path that is constructed by the AIML interpreter at load
+ time.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="that" type="MixedPatternExpression" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>The pattern-side that element is a special type of pattern
+ element used for context matching. The pattern-side that is optional in a
+ category, but if it occurs it must occur no more than once, and must
+ immediately follow the pattern and immediately precede the template. A
+ pattern-side that element contains a simple pattern expression. The contents
+ of the pattern-side that are appended to the full match path that is
+ constructed by the AIML interpreter at load time. If a category does not
+ contain a pattern-side that, the AIML interpreter must assume an "implied"
+ pattern-side that containing the pattern expression * (single asterisk
+ wildcard).</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="template" type="MixedTemplateContentContainer">
+ <xs:annotation>
+ <xs:documentation>The majority of AIML content is within the template. The
+ template may contain zero or more AIML template elements mixed with
+ character data.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="MixedPatternExpression" mixed="true">
+ <xs:annotation>
+ <xs:documentation>A mixed pattern expression is composed from one or more mixed pattern
+ expression constituents, separated by XML spaces (&amp;#x20).</xs:documentation>
+ </xs:annotation>
+ <!--<xs:complexContent mixed="true">
+ <xs:extension base="SimplePatternExpression">-->
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="bot" type="BotPredicate"/>
+ </xs:choice>
+ <!--</xs:extension>
+ </xs:complexContent>-->
+ </xs:complexType>
+ <xs:simpleType name="SimplePatternExpression">
+ <xs:annotation>
+ <xs:documentation>A simple pattern expression is composed from one or more simple
+ pattern expression constituents, separated by XML spaces (#x20).</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:pattern value="((\d|\p{Lu})+|\*|_)( +((\d|\p{Lu})+|\*|_))*"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:complexType name="MixedTemplateContentContainer" mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="atomicElements"/>
+ <xs:group ref="textFormattingElements"/>
+ <xs:group ref="conditionalElements"/>
+ <xs:group ref="captureElements"/>
+ <xs:group ref="symbolicReductionElements"/>
+ <xs:group ref="transformationalElements"/>
+ <xs:group ref="covertElements"/>
+ <xs:group ref="externalProcessorElements"/>
+ <xs:any namespace="##other" processContents="lax"/>
+ </xs:choice>
+ </xs:complexType>
+ <xs:group name="atomicElements">
+ <xs:annotation>
+ <xs:documentation>An atomic template element in AIML indicates to an AIML interpreter
+ that it must return a value according to the functional meaning of the element.
+ Atomic elements do not have any content.</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element name="star" type="IndexedElement">
+ <xs:annotation>
+ <xs:documentation>The star element indicates that an AIML interpreter should
+ substitute the value "captured" by a particular wildcard from the
+ pattern-specified portion of the match path when returning the template. The
+ star element has an optional integer index attribute that indicates which
+ wildcard to use. The minimum acceptable value for the index is "1" (the
+ first wildcard), and the maximum acceptable value is equal to the number of
+ wildcards in the pattern. </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="that" type="OneOrTwoDIndexedElement">
+ <xs:annotation>
+ <xs:documentation>The pattern-side that element is a special type of pattern
+ element used for context matching. The pattern-side that is optional in a
+ category, but if it occurs it must occur no more than once, and must
+ immediately follow the pattern and immediately precede the template. A
+ pattern-side that element contains a simple pattern expression. The contents
+ of the pattern-side that are appended to the full match path that is
+ constructed by the AIML interpreter at load time. If a category does not
+ contain a pattern-side that, the AIML interpreter must assume an "implied"
+ pattern-side that containing the pattern expression * (single asterisk
+ wildcard). </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="input" type="OneOrTwoDIndexedElement">
+ <xs:annotation>
+ <xs:documentation>The input element tells the AIML interpreter that it should
+ substitute the contents of a previous user input. The template-side input
+ has an optional index attribute that may contain either a single integer or
+ a comma-separated pair of integers. The minimum value for either of the
+ integers in the index is "1". The index tells the AIML interpreter which
+ previous user input should be returned (first dimension), and optionally
+ which "sentence" of the previous user input. The AIML interpreter should
+ raise an error if either of the specified index dimensions is invalid at
+ run-time. An unspecified index is the equivalent of "1,1". An unspecified
+ second dimension of the index is the equivalent of specifying a "1" for the
+ second dimension.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="thatstar" type="IndexedElement">
+ <xs:annotation>
+ <xs:documentation>The thatstar element tells the AIML interpreter that it should
+ substitute the contents of a wildcard from a pattern-side that element. The
+ thatstar element has an optional integer index attribute that indicates
+ which wildcard to use; the minimum acceptable value for the index is "1"
+ (the first wildcard). An AIML interpreter should raise an error if the index
+ attribute of a star specifies a wildcard that does not exist in the that
+ element's pattern content. Not specifying the index is the same as
+ specifying an index of "1".</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="topicstar" type="IndexedElement">
+ <xs:annotation>
+ <xs:documentation> The topicstar element tells the AIML interpreter that it
+ should substitute the contents of a wildcard from the current topic (if the
+ topic contains any wildcards). The topicstar element has an optional integer
+ index attribute that indicates which wildcard to use; the minimum acceptable
+ value for the index is "1" (the first wildcard). Not specifying the index is
+ the same as specifying an index of "1".</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="get">
+ <xs:annotation>
+ <xs:documentation> The get element tells the AIML interpreter that it should
+ substitute the contents of a predicate, if that predicate has a value
+ defined. If the predicate has no value defined, the AIML interpreter should
+ substitute the empty string "". The AIML interpreter implementation may
+ optionally provide a mechanism that allows the AIML author to designate
+ default values for certain predicates.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:attribute name="name" type="PredicateName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="bot" type="BotPredicate"/>
+ <xs:group ref="shortcutElements"/>
+ <xs:group ref="systemDefinedPredicates"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="BotPredicate">
+ <xs:annotation>
+ <xs:documentation> An element called bot, which may be considered a restricted
+ version of get, is used to tell the AIML interpreter that it should
+ substitute the contents of a "bot predicate". The value of a bot predicate
+ is set at load-time, and cannot be changed at run-time. The AIML interpreter
+ may decide how to set the values of bot predicate at load-time. If the bot
+ predicate has no value defined, the AIML interpreter should substitute an
+ empty string.</xs:documentation>
+ </xs:annotation>
+ <xs:attribute name="name" type="PredicateName" use="required"/>
+ </xs:complexType>
+ <xs:group name="shortcutElements">
+ <xs:annotation>
+ <xs:documentation>Several atomic AIML elements are "short-cuts" for combinations of
+ other AIML elements.</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element name="sr">
+ <xs:annotation>
+ <xs:documentation>The sr element is a shortcut for:
+ &lt;srai&gt;&lt;star/&gt;&lt;/srai&gt; The atomic sr
+ does not have any content. </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <!--
+ <xs:element name="person" xsi:type="IndexedElement">
+ <xs:annotation>
+ <xs:documentation>The atomic version of the person element is a shortcut for:
+ &lt;person&gt;&lt;star/&gt;&lt;/person&gt; The
+ atomic person does not have any content. </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="person2" xsi:type="IndexedElement">
+ <xs:annotation>
+ <xs:documentation>The atomic version of the person2 element is a shortcut for:
+ &lt;person2&gt;&lt;star/&gt;&lt;/person2&gt; The
+ atomic person does not have any content. </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="gender" xsi:type="IndexedElement">
+ <xs:annotation>
+ <xs:documentation>The atomic version of the gender element is a shortcut for:
+ &lt;gender&gt;&lt;star/&gt;&lt;/gender&gt; The
+ atomic gender does not have any content. </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ -->
+ </xs:choice>
+ </xs:group>
+ <xs:group name="systemDefinedPredicates">
+ <xs:annotation>
+ <xs:documentation>Several atomic AIML elements require the AIML interpreter to
+ substitute a value that is determined from the system, independently of the AIML
+ content.</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element name="date">
+ <xs:annotation>
+ <xs:documentation> The date element tells the AIML interpreter that it should
+ substitute the system local date and time. No formatting constraints on the
+ output are specified.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="id">
+ <xs:annotation>
+ <xs:documentation>The id element tells the AIML interpreter that it should
+ substitute the user ID. The determination of the user ID is not specified,
+ since it will vary by application. A suggested default return value is
+ "localhost".</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="size">
+ <xs:annotation>
+ <xs:documentation>The size element tells the AIML interpreter that it should
+ substitute the number of categories currently loaded.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version">
+ <xs:annotation>
+ <xs:documentation>The version element tells the AIML interpreter that it should
+ substitute the version number of the AIML interpreter.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="textFormattingElements">
+ <xs:annotation>
+ <xs:documentation>Text-formatting elements instruct an AIML interpreter to perform
+ locale-specific post-processing of the textual results of the processing of their
+ contents.</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element name="uppercase" type="MixedTemplateContentContainer"/>
+ <xs:element name="lowercase" type="MixedTemplateContentContainer"/>
+ <xs:element name="formal" type="MixedTemplateContentContainer"/>
+ <xs:element name="sentence" type="MixedTemplateContentContainer"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="conditionalElements">
+ <xs:choice>
+ <xs:element name="condition">
+ <xs:annotation>
+ <xs:documentation>The condition element instructs the AIML interpreter to return
+ specified contents depending upon the results of matching a predicate
+ against a pattern. NOTE: The definition in this Schema is currently far too
+ permissive. AIML conditions have several forms and constraints that can't be
+ expressed using W3C Schema alone. For this reason, AIML objects that
+ validate using this Schema alone may not actually be valid AIML.</xs:documentation>
+ <xs:appinfo>
+ <sch:pattern name="valid condition type">
+ <sch:rule context="aiml:condition">
+ <sch:assert
+ test="(@name and @value and not(aiml:li)) or (@name and not(@value) and aiml:li[@value and not(@name)] and not(aiml:li[@name]) and count(aiml:li[not(@value) and not(@name)]) &lt;= 1) or (not(@name) and not(@value) and aiml:li[@name and @value] and not(aiml:li[(@name and not(@value)) or (@value and not(@name))]) and count(aiml:li[not(@value) and not(@name)]) &lt;= 1)"
+ > A condition must be a block condition, a single-predicate
+ condition, or a multi-predicate condition. </sch:assert>
+ </sch:rule>
+ </sch:pattern>
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <!--
+ <xs:choice>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="li">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="MixedTemplateContentContainer">
+ <xs:attribute name="name" type="PredicateName"/>
+ <xs:attribute name="value" type="SimplePatternExpression"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ -->
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any namespace="##any" processContents="lax"/>
+ </xs:sequence>
+ <!--
+ </xs:choice>
+ -->
+ <xs:attribute name="name" type="PredicateName"/>
+ <xs:attribute name="value" type="SimplePatternExpression"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="random">
+ <xs:annotation>
+ <xs:documentation>The random element instructs the AIML interpreter to return
+ exactly one of its contained li elements randomly.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="li" type="MixedTemplateContentContainer"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="captureElements">
+ <xs:annotation>
+ <xs:documentation>AIML defines two content-capturing elements, which tell the AIML
+ interpreter to capture their processed contents and perform some storage operation
+ with them.</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element name="set">
+ <xs:annotation>
+ <xs:documentation>The set element instructs the AIML interpreter to set the
+ value of a predicate to the result of processing the contents of the set
+ element. The set element has a required attribute name, which must be a
+ valid AIML predicate name. If the predicate has not yet been defined, the
+ AIML interpreter should define it in memory.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="MixedTemplateContentContainer">
+ <xs:attribute name="name" type="PredicateName"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="gossip" type="MixedTemplateContentContainer">
+ <xs:annotation>
+ <xs:documentation> The gossip element instructs the AIML interpreter to capture
+ the result of processing the contents of the gossip elements and to store
+ these contents in a manner left up to the implementation. Most common uses
+ of gossip have been to store captured contents in a separate
+ file.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="symbolicReductionElements">
+ <xs:choice>
+ <xs:element name="srai" type="MixedTemplateContentContainer">
+ <xs:annotation>
+ <xs:documentation> The srai element instructs the AIML interpreter to pass the
+ result of processing the contents of the srai element to the AIML matching
+ loop, as if the input had been produced by the user (this includes stepping
+ through the entire input normalization process).</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="transformationalElements">
+ <xs:choice>
+ <xs:element name="person" type="MixedTemplateContentContainer">
+ <xs:annotation>
+ <xs:documentation>The person element instructs the AIML interpreter to: 1.
+ replace words with first-person aspect in the result of processing the
+ contents of the person element with words with the
+ grammatically-corresponding third-person aspect; and 2. replace words with
+ third-person aspect in the result of processing the contents of the person
+ element with words with the grammatically-corresponding first-person aspect.
+ The definition of "grammatically-corresponding" is left up to the
+ implementation.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="person2" type="MixedTemplateContentContainer">
+ <xs:annotation>
+ <xs:documentation>The person2 element instructs the AIML interpreter to: 1.
+ replace words with first-person aspect in the result of processing the
+ contents of the person2 element with words with the
+ grammatically-corresponding second-person aspect; and 2. replace words with
+ second-person aspect in the result of processing the contents of the person2
+ element with words with the grammatically-corresponding first-person aspect.
+ The definition of "grammatically-corresponding" is left up to the
+ implementation.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="gender" type="MixedTemplateContentContainer">
+ <xs:annotation>
+ <xs:documentation>The gender element instructs the AIML interpreter to: 1.
+ replace male-gendered words in the result of processing the contents of the
+ gender element with the grammatically-corresponding female-gendered words;
+ and 2. replace female-gendered words in the result of processing the
+ contents of the gender element with the grammatically-corresponding
+ male-gendered words. The definition of "grammatically-corresponding" is left
+ up to the implementation. Historically, implementations of gender have
+ exclusively dealt with pronouns, likely due to the fact that most AIML has
+ been written in English. However, the decision about whether to transform
+ gender of other words is left up to the implementation.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="covertElements">
+ <xs:annotation>
+ <xs:documentation>AIML defines two "covert" elements that instruct the AIML interpreter
+ to perform some processing on their contents, but to not return any
+ value.</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element name="think" type="MixedTemplateContentContainer">
+ <xs:annotation>
+ <xs:documentation>The think element instructs the AIML interpreter to perform
+ all usual processing of its contents, but to not return any value,
+ regardless of whether the contents produce output.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="learn">
+ <xs:simpleType>
+ <xs:annotation>
+ <xs:documentation>The learn element instructs the AIML interpreter to
+ retrieve a resource specified by a URI, and to process its AIML object
+ contents.</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:anyURI"/>
+ </xs:simpleType>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="externalProcessorElements">
+ <xs:annotation>
+ <xs:documentation>AIML defines two external processor elements, which instruct the AIML
+ interpreter to pass the contents of the elements to an external processor. External
+ processor elements may return a value, but are not required to do so. Contents of
+ external processor elements may consist of character data as well as AIML template
+ elements. If AIML template elements in the contents of an external processor element
+ are not enclosed as CDATA, then the AIML interpreter is required to substitute the
+ results of processing those elements before passing the contents to the external
+ processor. AIML does not require that any contents of an external processor element
+ are enclosed as CDATA. An AIML interpreter should assume that any unrecognized
+ content is character data, and simply pass it to the appropriate external processor
+ as-is, following any processing of AIML template elements not enclosed as CDATA. If
+ an external processor is not available to process the contents of an external
+ processor element, the AIML interpreter may return an error, but this is not
+ required.</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element name="system" type="MixedTemplateContentContainer">
+ <xs:annotation>
+ <xs:documentation>The system element instructs the AIML interpreter to pass its
+ content (with any appropriate preprocessing) to the system command
+ interpreter of the local machine on which the AIML interpreter is
+ running.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="javascript" type="MixedTemplateContentContainer">
+ <xs:annotation>
+ <xs:documentation>The javascript element instructs the AIML interpreter to pass
+ its content (with any appropriate preprocessing, as noted above) to a
+ server-side JavaScript interpreter on the local machine on which the AIML
+ interpreter is running. The javascript element does not have any attributes.
+ AIML does not require that an AIML interpreter include a server-side
+ JavaScript interpreter, and does not require any particular behavior from
+ the server-side JavaScript interpreter if it exists. The javascript element
+ may return a value.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="OneOrTwoDIndexedElement">
+ <xs:attribute name="index">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:pattern value="\d+|\d+,\d+"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ <xs:complexType name="IndexedElement">
+ <xs:attribute name="index" type="xs:integer"/>
+ </xs:complexType>
+ <xs:simpleType name="PredicateName">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\c+"/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
View
77 install/config.tpl.htm
@@ -226,30 +226,25 @@
<td><span class="formw"><input name="local_dbPort" id="local_dbPort" value="[local_dbPort]" /></span></td>
</tr>
<tr>
- <td><label for="bot_count"><span class="label">Number of bots<span style="float:right" class="helpButton" id="hb_bot_count"> </span></span></label></td>
- <td><span class="formw"><input name="bot_count" id="bot_count" /></span></td>
+ <td colspan="2" class="bold center" >Botmaster Info:</td>
<td><label for="local_dbn"><span class="label">Local Database Name <span style="float:right" class="helpButton" id="hb_local_dbn"> </span></span></label></td>
<td><span class="formw"><input name="local_dbn" id="local_dbn" value="[local_dbn]" /></span></td>
</tr>
<tr>
- <td><label for="botNames"><span class="label">Bot Names <span class="red">*</span><span style="float:right" class="helpButton" id="hb_botNames"> </span></span></label></td>
- <td><span class="formw"><textarea name="botNames" id="botNames" rows="1">myBot</textarea></span></td>
+ <td><label for="adm_dbu"><span class="label">Admin User Name <span class="red small">(required)</span><span style="float:right" class="helpButton" id="hb_adm_dbu"> </span></span></label></td>
+ <td><span class="formw"><input name="adm_dbu" id="adm_dbu" value="[adm_dbu]" /></span></td>
<td><label for="local_dbu"><span class="label">Local Database Username <span style="float:right" class="helpButton" id="hb_local_dbu"> </span></span></label></td>
<td><span class="formw"><input name="local_dbu" id="local_dbu" value="[local_dbu]" /></span></td>
</tr>
<tr>
- <td><label for="default_bot_id"><span class="label">Name of the default bot<span style="float:right" class="helpButton" id="hb_default_bot_id"> </span></span></label></td>
- <td>
- <span class="formw">
- <select name="default_bot_id" id="default_bot_id">
- </select>
- </span>
- </td>
+ <td><label for="adm_dbp"><span class="label">Admin Password <span class="red small">(required)</span><span style="float:right" class="helpButton" id="hb_adm_dbp"> </span></span></label></td>
+ <td><span class="formw"><input name="adm_dbp" id="adm_dbp" type="password" /></span></td>
<td><label for="local_dbp"><span class="label">Local Database Password <span style="float:right" class="helpButton" id="hb_local_dbp"> </span></span></label></td>
<td><span class="formw"><input name="local_dbp" id="local_dbp" value="[local_dbp]" /></span></td>
</tr>
<tr>
- <td colspan="2" class="bold center" >Botmaster Info:</td>
+ <td><label for="adm_dbp_confirm"><span class="label">Confirm Password <span class="red small">(required)</span><span style="float:right" class="helpButton" id="hb_adm_dbp_confirm"> </span></span></label></td>
+ <td><span class="formw"><input name="adm_dbp_confirm" id="adm_dbp_confirm" type="password" /></span></td>
<td><label for="lsTZ"><span class="label">Local Database Timezone<span style="float:right" class="helpButton" id="hb_lsTZ"> </span></span></label></td>
<td>
<span class="formw">
@@ -259,58 +254,35 @@
</td>
</tr>
<tr>
- <td><label for="adm_dbu"><span class="label">Admin User Name <span class="red small">(required)</span><span style="float:right" class="helpButton" id="hb_adm_dbu"> </span></span></label></td>
- <td><span class="formw"><input name="adm_dbu" id="adm_dbu" value="[adm_dbu]" /></span></td>
- <td class="bold center" colspan="2"><b>Remote Database Data</b></td>
- </tr>
- <tr>
- <td><label for="adm_dbp"><span class="label">Admin Password <span class="red small">(required)</span><span style="float:right" class="helpButton" id="hb_adm_dbp"> </span></span></label></td>
- <td><span class="formw"><input name="adm_dbp" id="adm_dbp" type="password" /></span></td>
- <td><label for="remote_dbh"><span class="label">Remote Database Host Name <span style="float:right" class="helpButton" id="hb_remote_dbh"> </span></span></label></td>
- <td><span class="formw"><input name="remote_dbh" id="remote_dbh" value="[remotehost]" /></span></td>
- </tr>
- <tr>
- <td><label for="adm_dbp_confirm"><span class="label">Confirm Password <span class="red small">(required)</span><span style="float:right" class="helpButton" id="hb_adm_dbp_confirm"> </span></span></label></td>
- <td><span class="formw"><input name="adm_dbp_confirm" id="adm_dbp_confirm" type="password" /></span></td>
- <td><label for="remote_dbPort"><span class="label">Remote Database Port <span style="float:right" class="helpButton" id="hb_remote_dbPort"> </span></span></label></td>
- <td><span class="formw"><input name="remote_dbPort" id="remote_dbPort" value="[remote_dbPort]" /></span></td>
- </tr>
- <tr>
<td><label for="botmaster_name"><span class="label">Your Name <span class="red small">(required)</span><span style="float:right" class="helpButton" id="hb_botmaster_name"> </span></span></label></td>
<td><span class="formw"><input name="botmaster_name" id="botmaster_name" value="[botmaster_name]" /></span></td>
- <td><label for="remote_dbn"><span class="label">Remote Database Name <span style="float:right" class="helpButton" id="hb_remote_dbn"> </span></span></label></td>
- <td><span class="formw"><input name="remote_dbn" id="remote_dbn" value="[remote_dbn]" /></span></td>
+ <td class="bold center" colspan="2"><b>Remote Database Data</b></td>
</tr>
<tr>
<td><label for="default_debugemail"><span class="label">Email Address <span class="red small">(required)</span><span style="float:right" class="helpButton" id="hb_default_debugemail"> </span></span></label></td>
<td><span class="formw"><input name="default_debugemail" id="default_debugemail" value="[default_debugemail]" /></span></td>
- <td><label for="remote_dbu"><span class="label">Remote Database Username <span style="float:right" class="helpButton" id="hb_remote_dbu"> </span></span></label></td>
- <td><span class="formw"><input name="remote_dbu" id="remote_dbu" value="[remote_dbu]" /></span></td>
+ <td><label for="remote_dbh"><span class="label">Remote Database Host Name <span style="float:right" class="helpButton" id="hb_remote_dbh"> </span></span></label></td>
+ <td><span class="formw"><input name="remote_dbh" id="remote_dbh" value="[remotehost]" /></span></td>
</tr>
<tr>
<td colspan="2" class="bold center">Debugging Options:</td>
- <td><label for="remote_dbp"><span class="label">Remote Database Password <span style="float:right" class="helpButton" id="hb_remote_dbp"> </span></span></label></td>
- <td><span class="formw"><input name="remote_dbp" id="remote_dbp" value="[remote_dbp]" /></span></td>
+ <td><label for="remote_dbPort"><span class="label">Remote Database Port <span style="float:right" class="helpButton" id="hb_remote_dbPort"> </span></span></label></td>
+ <td><span class="formw"><input name="remote_dbPort" id="remote_dbPort" value="[remote_dbPort]" /></span></td>
</tr>
<tr>
<td><label for="default_debugshow"><span class="label">Debug Level:<span style="float:right" class="helpButton" id="hb_default_debugshow"> </span></span></label></td>
<td>
<span class="formw">
<select name="default_debugshow" id="default_debugshow" size="1">
- <option value="0" selected="selected">Nothing</option>
- <option value="1">General</option>
+ <option value="0">Nothing</option>
+ <option value="1" selected="selected">General</option>
<option value="2">General/SQL</option>
<option value="3">Everything</option>
</select>
</span>
</td>
- <td><label for="rsTZ"><span class="label">Remote Database Timezone <span style="float:right" class="helpButton" id="hb_rsTZ"> </span></span></label></td>
- <td>
- <span class="formw">
- <select name="rsTZ" id="rsTZ">
- </select>
- </span>
- </td>
+ <td><label for="remote_dbn"><span class="label">Remote Database Name <span style="float:right" class="helpButton" id="hb_remote_dbn"> </span></span></label></td>
+ <td><span class="formw"><input name="remote_dbn" id="remote_dbn" value="[remote_dbn]" /></span></td>
</tr>
<tr>
<td><span class="label">Debugging output method<span style="float:right" class="helpButton" id="hb_default_debugmode"> </span></span></td>
@@ -322,7 +294,8 @@
<label for="default_debugmodeEmail"><input type="radio" class="radio" name="default_debugmode" value="3" id="default_debugmodeEmail" />Email</label>
</span>
</td>
- <td colspan="2" rowspan="7" id="notes">[notes]</td>
+ <td><label for="remote_dbu"><span class="label">Remote Database Username <span style="float:right" class="helpButton" id="hb_remote_dbu"> </span></span></label></td>
+ <td><span class="formw"><input name="remote_dbu" id="remote_dbu" value="[remote_dbu]" /></span></td>
</tr>
<tr>
<td><label for="default_save_state"><span class="label">Save-State<span style="float:right" class="helpButton" id="hb_default_save_state"> </span></span></label></td>
@@ -332,6 +305,8 @@
<label for="default_save_stateDB"><input type="radio" class="radio" name="default_save_state" id="default_save_stateDB" value="database" />Database</label>
</span>
</td>
+ <td><label for="remote_dbp"><span class="label">Remote Database Password <span style="float:right" class="helpButton" id="hb_remote_dbp"> </span></span></label></td>
+ <td><span class="formw"><input name="remote_dbp" id="remote_dbp" value="[remote_dbp]" /></span></td>
</tr>
<tr>
<td><label for="default_format"><span class="label">Response Format<span style="float:right" class="helpButton" id="hb_default_format"> </span></span></label></td>
@@ -344,10 +319,18 @@
</select>
</span>
</td>
+ <td><label for="rsTZ"><span class="label">Remote Database Timezone <span style="float:right" class="helpButton" id="hb_rsTZ"> </span></span></label></td>
+ <td>
+ <span class="formw">
+ <select name="rsTZ" id="rsTZ">
+ </select>
+ </span>
+ </td>
</tr>
<tr>
<td><label for="error_response"><span class="label">Error response string<span style="float:right" class="helpButton" id="hb_error_response"> </span></span></label></td>
<td><span class="formw"><input class="wide" name="error_response" id="error_response" value="[error_response]" /></span></td>
+ <td colspan="2" rowspan="4" id="notes">[notes]</td>
</tr>
<tr>
<td><label for="default_pattern"><span class="label">Default pickup line pattern<span style="float:right" class="helpButton" id="hb_default_pattern"> </span></span></label></td>
@@ -395,6 +378,10 @@
<!-- Section Page 1 Notes Start -->
<div class="row"><span class="red"># </span>Note: This is generally the server computer's local network name.</div>
<div class="row"><span class="red">* </span>Note: Place each bot name on a separate line. At least one name is required.</div>
+ <div class="row">
+ For more detailed information with this page, please see the <a href="help.php" target="_blank">Help Page</a>, or
+ click the help icon <img src="../../admin/images/help_small.png" width="16" height="16" alt="" /> for an individual field.
+ </div>
<!-- Section Page 1 Notes End -->
<!-- Section Page 2 Notes Start -->
<!-- Section Page 2 Notes End -->
View
65 install/help.tpl.htm
@@ -96,7 +96,7 @@
rather than using the local DB settings. Set this to the local "network name" of your computer.
</div>
</div>
- <div class="row" id="bot_count">
+ <!--div class="row" id="bot_count">
<span class="label">Number of bots</span>
<div class="description">
The default is one (1) bot, and in most cases the script will automatically set this to the correct value.
@@ -113,7 +113,7 @@
This is the name of your primary (default) bot. Simply select the name you want to use from the drop-down list,
<b>after</b> you set the names of your bot(s).
</div>
- </div>
+ </div-->
<div class="row">
<strong>Botmaster Info</strong>
</div>
@@ -235,7 +235,7 @@
configure.
</li>
</ul>
- There are sample pages in the <a href="../gui/index.php">gui directory</a> that you can
+ There are sample pages in the <a href="../gui/index.php">GUI directory</a> that you can
examine and use, but bear in mind that these are simply example pages, and will likely require some
modification prior to use.
</div>
@@ -283,88 +283,119 @@
<div class="row bold"><b>Local Database Data</b></div>
<div class="row" id="local_dbh">
<span class="label">Local Database Host Name</span>
- <div id="description">
+ <div class="description">
Default: localhost<br />
Required: This setting is part of the local database login credentials that allow Program O to connect to your
bot's local database. Under the vast majority of circumstances, this is simply 'localhost', but there is
- the occaisional rare exception.
+ the occasional rare exception.
</div>
</div>
<div class="row" id="local_dbPort">
<span class="label">Local Database Port</span>
- <div id="description">
+ <div class="description">
Default: 3306<br />
Required only in the very rare case that the database server has been configured to use a different port.
</div>
</div>
<div class="row" id="local_dbn">
<span class="label">Local Database Name</span>
- <div id="description">
+ <div class="description">
Required: When you performed the task of creating your local database, you should have already named the DB,
along with configuring username and password. The DB name from that information goes here.
</div>
</div>
<div class="row" id="local_dbu">
<span class="label">Local Database Username</span>
- <div id="description">
- Required: Just as with the name of the database, above, this is part of the connection infrmation that you
+ <div class="description">
+ Required: Just as with the name of the database, above, this is part of the connection information that you
should have gathered when you set up your bot's DB.
</div>
</div>
<div class="row" id="local_dbp">
<span class="label">Local Database Password</span>
- <div id="description">
+ <div class="description">
Required: This is the password for your script to access your bot's database. There's no confirmation for
this field, like there was with the admin password, earlier, so be careful to ensure it's entered correctly.
</div>
</div>
<div class="row" id="lsTZ">
<span class="label">Local Database Timezone</span>
- <div id="description">
+ <div class="description">
This is the timezone info for your local server (the one you're currently using).
This setting should be automatically set by the installation script, but you should verify it's accuracy.
</div>
</div>
<div class="row bold"><b>Remote Database Data</b></div>
<div class="row" id="remote_dbh">
<span class="label">Remote Database Host Name</span>
- <div id="description">
+ <div class="description">
Required: This is the host name of the remote database server, and again is part of the information that you
should have already gathered when you created your remote database.
</div>
</div>
<div class="row" id="remote_dbPort">
<span class="label">Remote Database Port</span>
- <div id="description">
+ <div class="description">
Default: 3306<br />
Just like the local database port, this setting is only required if the database server uses a non-standard
port.
</div>
</div>
<div class="row" id="remote_dbn">
<span class="label">Remote Database Name</span>
- <div id="description">
+ <div class="description">
Required: See <a href="help.php?page=1#local_dbn">Local DB name</a> for details.
</div>
</div>
<div class="row" id="remote_dbu">
<span class="label">Remote Database Username</span>
- <div id="description">
+ <div class="description">
Required: See <a href="help.php?page=1#local_dbu">Local Database Username</a> for details.
</div>
</div>
<div class="row" id="remote_dbp">
<span class="label">Remote Database Password</span>
- <div id="description">
+ <div class="description">
Required: See <a href="help.php?page=1#local_dbu">Local Database Password</a> for details.
</div>
</div>
<div class="row" id="rsTZ">
<span class="label">Remote Database Timezone</span>
- <div id="description">
+ <div class="description">
Required, but automatically generated: See <a href="help.php?page=1#lsTZ">Local Database Timezone</a> for details.
</div>
</div>
+ <div class="row">&nbsp;</div>
+ <div class="center">
+ <strong>Troubleshooting</strong>
+ </div>
+ <div class="row" id="permissions">
+ <span class="label">File Permissions</span>
+ <div class="description">
+ <p>
+ If you've been directed here, then your web server doesn't allow the install script to modify file permissions automatically.
+ If this is the case, then modification of the permissions for the config file will have to be done manually, <strong>BEFORE</strong>
+ the install script can continue. Otherwise, you'll end up with a corrupted installation, and will have to start over.
+ This problem seems to be limited to Linux systems, since Windows handles file permissions differently.
+ </p>
+ <p>
+ To manually change file permissions on a remote server, you usually have a couple of options. If your hosting provider provides
+ a user control panel, you can use the File Management section to change permissions. You can also use the FTP client software
+ that you used to upload the file to change permissions. The methods for changing file permissions with an FTP client application
+ vary from program to program, so if you're unsure about how to go about the task, try reading your FTP program's Help file.
+ Search for either "file permissions", or "CHMOD". If you still need help, feel free to visit the
+ <a href="http://forum.program-o.com/">Program O Support Forum</a> to ask for assistance.
+ </p>
+ <p>
+ The correct setting for the file permissions for the config file is 755. If you're unsure what this means, then have a look at
+ <a href="http://www.perlfect.com/articles/chmod.shtml">http://www.perlfect.com/articles/chmod.shtml</a> for a good tutorial
+ about the CHMOD command, and what the various settings mean. For our purposes, that setting means that the config file can
+ only be written to by the file's "owner", while everyone can read and execute the file. If the file can't be properly written
+ to, then the script can't save the settings that you've set or changed, and your bot won't work correctly, so it's important
+ that the config file has it's permissions set correctly.
+ </p>
+ </div>
+ </div>
<!-- Section Page1 End -->
<!-- Section Page2 Start -->
<!-- Section Page2 End -->

0 comments on commit cb4aef6

Please sign in to comment.
Something went wrong with that request. Please try again.