[docs] xmldocs - docelic modified 7 files

docs at icdevgroup.org docs at icdevgroup.org
Sun Dec 18 06:32:12 EST 2005


User:      docelic
Date:      2005-12-18 11:32:11 GMT
Modified:  refs     Database catch.tag checked.tag counter.tag
Modified:           dump_session.tag
Added:     refs     SearchProfile SysLog
Log:
* Some updates to existing files
* Two new documented

Revision  Changes    Path
1.2       +5 -0      xmldocs/refs/Database


rev 1.2, prev_rev 1.1
Index: Database
===================================================================
RCS file: /var/cvs/xmldocs/refs/Database,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Database	10 Apr 2005 20:37:21 -0000	1.1
+++ Database	18 Dec 2005 11:32:11 -0000	1.2
@@ -28,6 +28,11 @@
 __NAME__ notes
 In &IC;, words <literal>table</literal> and <literal>database</literal>
 are used to refer to the same thing &mdash; database table.
+</para><para>
+Defining databases on an &IC; (global) level
+<emphasis role='bold'>does not work</emphasis>! If you want to share
+databases among catalogs, define them in each &ccf; separately (possibly
+by including the generic file with &conf-Database; definitions).
 __END__
 
 __NAME__ example: Default, most basic products database



1.5       +1 -1      xmldocs/refs/catch.tag


rev 1.5, prev_rev 1.4
Index: catch.tag
===================================================================
RCS file: /var/cvs/xmldocs/refs/catch.tag,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- catch.tag	19 Nov 2005 22:37:41 -0000	1.4
+++ catch.tag	18 Dec 2005 11:32:11 -0000	1.5
@@ -19,7 +19,7 @@
 	</entry>
 	<entry>
 	Name to assign to the &tag-try; block. The name is later used by
-	&tag-cache; (or some custom code) to refer to the proper &tag-try;
+	&tag-catch; (or some custom code) to refer to the proper &tag-try;
 	block.
 	</entry>
 



1.2       +65 -1     xmldocs/refs/checked.tag


rev 1.2, prev_rev 1.1
Index: checked.tag
===================================================================
RCS file: /var/cvs/xmldocs/refs/checked.tag,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- checked.tag	17 Feb 2005 23:25:39 -0000	1.1
+++ checked.tag	18 Dec 2005 11:32:11 -0000	1.2
@@ -40,6 +40,25 @@
 <row>
 
 	<entry>
+	value
+	</entry>
+	<entry>
+	<!-- POS -->
+	</entry>
+	<entry>
+	<!-- REQ -->
+	</entry>
+	<entry>
+	<!-- DFL -->
+	</entry>
+	<entry>
+	<!-- DSC -->
+	</entry>
+
+</row> 
+<row>
+
+	<entry>
 	case
 	</entry>
 	<entry>
@@ -96,4 +115,49 @@
 </row> 
 &ROW_INTERPOLATE_0;
 &ROW_REPARSE_1;
-__END__
\ No newline at end of file
+__END__
+
+
+__NAME__ see also
+selected
+__END__
+
+__NAME__ description
+The tag provides "memory" for &glos-HTML; checkboxes and radio buttons.
+__END__
+
+
+
+
+You can provide a "memory" for drop-down menus, radio buttons, and
+checkboxes with the [checked] and [selected] tags.
+
+>    <INPUT TYPE=radio NAME=foo
+>            VALUE=on [checked name=foo value=on default=1]>
+>    <INPUT TYPE=radio NAME=foo
+>            VALUE=off [checked name=foo value=off]>
+
+This will output CHECKED if the variable C<var_name> is equal to
+C<value>. Not case sensitive unless the optional C<case=1> parameter is used.
+
+The C<default> parameter, if true (non-zero and non-blank), will cause
+the box to be checked if the variable has never been defined.
+
+Note that CHECKBOX items will never submit their value if not checked,
+so the box will not be reset. You must do something like:
+
+>    <INPUT TYPE=checkbox NAME=foo
+>            VALUE=1 [checked name=foo value=1 default=1]>
+>    [value name=foo set=""]
+
+By default, the Values space (i.e. [value foo]) is checkedE<nbspace>E<emdash> if you
+want to use the volatile CGI space (i.e. [cgi foo]) use the option
+C<cgi=1>.
+
+Use the parameter C<default=1> to specify that this checkbox should be
+marked CHECKED if the value/CGI variable has never been set.
+
+If the parameter C<multiple=1> is set, the C<value> parameter can
+contain multiple (stacked) values that should be checked, separated
+by ASCII null characters ("\0" in Perl).
+



1.3       +43 -3     xmldocs/refs/counter.tag


rev 1.3, prev_rev 1.2
Index: counter.tag
===================================================================
RCS file: /var/cvs/xmldocs/refs/counter.tag,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- counter.tag	30 Apr 2005 22:56:53 -0000	1.2
+++ counter.tag	18 Dec 2005 11:32:11 -0000	1.3
@@ -1,3 +1,7 @@
+__NAME__ purpose
+manipulate a persistent, named counter
+__END__
+
 __NAME__ synopsis 
 <row>
 
@@ -56,7 +60,7 @@
   <!-- DFL -->
   </entry>
   <entry>
-  A <literal><replaceable>table</replaceable>:<replaceable>field</replaceable></literal> specification, if &tag-counter; is to increment a field in an SQL database.
+  A <literal><replaceable>table</replaceable>:<replaceable>field</replaceable></literal> specification, if &tag-counter; is to increment a field in an &glos-SQL; database.
   </entry>
 
 </row> 
@@ -275,8 +279,8 @@
 
 
 __NAME__ notes
-The SQL field-updating routine is database-dependent; please see the tag
-source for details.
+The &glos-SQL; field-updating routine is database-dependent; please see the tag
+source for exact behavior.
 </para><para>
 Date-based counters cannot be decremented.
 __END__
@@ -356,4 +360,40 @@
 [counter file=counter.m3 start=20 decrement=1 dec-routine=three_steps_back]
 </programlisting>
 __END__
+
+
+
+__NAME__ example: PostgreSQL database counter
+Create sequence <literal>counter1</literal> in the database:
+<programlisting>
+CREATE SEQUENCE "counter1" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+</programlisting>
+And use the counter on your pages:
+<programlisting>
+[counter sql="table1:counter1"]
+</programlisting>
+__END__
+
+__NAME__ example: MySQL database counter
+Create table <database>table2</literal> and a sequence <literal>counter2</literal> in that database:
+<programlisting>
+create table table2(counter2 int NOT NULL AUTO_INCREMENT PRIMARY KEY);
+</programlisting>
+And use the counter on your pages:
+<programlisting>
+[counter sql="table2:counter2"]
+</programlisting>
+__END__
+
+__NAME__ example: Oracle database counter
+Create a sequence <literal>counter3</literal> in the database:
+<programlisting>
+CREATE SEQUENCE counter3 START WITH 1 INCREMENT BY 1 MAXVALUE 2147483647 MINVALUE 1 CACHE 2;
+</programlisting>
+And use the counter on your pages:
+<programlisting>
+[counter sql="table3:counter3"]
+</programlisting>
+__END__
+
 



1.3       +1 -1      xmldocs/refs/dump_session.tag


rev 1.3, prev_rev 1.2
Index: dump_session.tag
===================================================================
RCS file: /var/cvs/xmldocs/refs/dump_session.tag,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dump_session.tag	14 Sep 2005 23:10:30 -0000	1.2
+++ dump_session.tag	18 Dec 2005 11:32:11 -0000	1.3
@@ -1,5 +1,5 @@
 __NAME__ purpose
-dump named user session in whole or partially
+dump named user session partially or in whole
 __END__
 
 



1.1                  xmldocs/refs/SearchProfile


rev 1.1, prev_rev 1.0
Index: SearchProfile
===================================================================
__NAME__ purpose
specify files containing search profile definitions
__END__


__NAME__ see also
OrderProfile,Profiles
__END__

__NAME__ synopsis
<group choice='req'>
	<arg choice='plain' rep='repeat'><replaceable>filename</replaceable></arg>
</group>
__END__


__NAME__ description
The directive specifies filenames that contain search
&glos-profile; definitions.
</para><para>
An unlimited number of search profiles
can be set up, performing complex searches on a
single user click. At the same time, separately-defined search profiles
keep your &glos-HTML; pages cleaner.
</para><para>
As said, 
multiple profiles can be defined, and within the same file.
In that case, profiles must be separated by <literal>__END__</literal>
tokens. Each opening <literal>__NAME__</literal> token should be left-aligned,
and each <literal>__END__</literal> should be on a line by itself,
with no leading or trailing whitespace.
__END__


__NAME__ notes
For a complete discussion, see &glos-profile; glossary entry.
__END__

__NAME__ example: Defining SearchProfile
<programlisting>
SearchProfile etc/profiles.search etc/search.profiles
</programlisting>
__END__



1.1                  xmldocs/refs/SysLog


rev 1.1, prev_rev 1.0
Index: SysLog
===================================================================
__NAME__ purpose
instruct Interchange to log to system's syslog
__END__

__NAME__ see also
ErrorFile,DebugFile
__END__

__NAME__ description
The directive configures
<citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>8</manvolnum></citerefentry>
logging for &IC;.
</para><para>
Besides just tuning syslog facility and priority settings, it is also
possible to specify external command to invoke for sending syslog messages.
This also means it is possible to hook into the message logging
system and route messages where ever you want. For example,
a custom wrapper can be created to log to a database. See an example
of it in <xref linkend="SysLog_examples"/>.
__END__



__NAME__ example: Simple syslog setup
<programlisting>
SysLog  command  /usr/bin/logger
SysLog  tag      int1
SysLog  alert    local3.warn
SysLog  warn     local3.info
SysLog  info     local3.info
SysLog  debug    local3.debug
</programlisting>

The above would cause messages to be logged with the command
<command>/usr/bin/logger -t int1 -p local3.alert <replaceable>...</replaceable></command>.
</para><para>
The generated system log entries would look somewhat like the following:

<screen>
Oct 26 17:30:11 bill int1: Config 'co' at server startup
Oct 26 17:30:11 bill int1: Config 'homefn' at server startup
Oct 26 17:30:11 bill int1: Config 'simple' at server startup
Oct 26 17:30:11 bill int1: Config 'test' at server startup
Oct 26 17:30:13 bill int1: START server (2345) (INET and UNIX)
</screen>
__END__


__NAME__ example: Sending facility 'local3' messages to appropriate log file
As you might know, messages sent using syslog reach the syslog daemon
sooner or later. There, they are examined and "routed" to their final
destination. For BSD-compatible syslog daemons, the configuration 
file is probably <filename>/etc/syslog.conf</filename>, and the 
configuration snippet needed to route &IC; messages to 
<filename>/var/log/interchange.log</filename> is as follows:
<programlisting>
# Log local3 stuff to Interchange log
local3.*                /var/log/interchange.log
</programlisting>
__END__


__NAME__ example: Custom logging script for logging to a database
<programlisting><![CDATA[
#!/usr/bin/perl
 
my $script_name = "logdatabase";
use DBI;
use Getopt::Std;
 
getopts('d:p:T:k:') or die "$script_name options: $@\n";
 
use vars qw/$opt_d $opt_p $opt_T $opt_k/;
 
my $dsn   = $opt_d || $ENV{DBI_DSN};
my $template = $opt_T
    || "insert into log values ('~~KEY~~', '~~LEVEL~~', '~~MSG~~')";
 
my $dbh = DBI->connect($dsn)
    or die "$script_name cannot connect to DBI: $DBI::errstr\n";
 
my %data;
 
$data{KEY} = $opt_k || '';
 
local ($/);
$data{MSG} = <>;
 
$data{LEVEL} = $opt_p || 'interchange.info';
 
$template =~ s/\~\~(\w+)\~\~/$dbh->quote($data{$1})/;
 
my $sth = $dbh->prepare($template)
    or die "$script_name error executing query: $template\n";
 
$sth->execute()
    or die "$script_name error executing query: $template\n";
 
exit;
]]></programlisting>
__END__









More information about the docs mailing list