From docs at icdevgroup.org Sun Apr 10 16:37:22 2005 From: docs at icdevgroup.org (docs@icdevgroup.org) Date: Sun Apr 10 16:37:27 2005 Subject: [docs] xmldocs - docelic modified 3 files Message-ID: <200504102037.j3AKbMZn020450@icdevgroup.org> User: docelic Date: 2005-04-10 20:37:21 GMT Added: glossary database Added: refs Database NoImport Log: We're back on stage :) New items, updates. Revision Changes Path 1.1 xmldocs/glossary/database rev 1.1, prev_rev 1.0 Index: database =================================================================== In general, databases contain some information, usually in tabular format, where columns define the names and types of contained data, and rows represent entries — database records. &IC; is primarily using databases to just retrieve values from specific tables, and does not use any higher-level functions of RDBM databases (such as views, triggers, or stored procedures in &PGSQL;). Such things can, however, be implemented in the database independently of &IC;, as Interchange will properly pass any warning or error messages back and forth. We should say right away that &IC; is completely database-independent. The choice of actual database types that can work with Interchange is large, and &IC; can use some database-like methods automatically when you're not explicitly interested in paying attention to databases working behind the scenes. Common features are transparently available everywhere (with absolutely no code hacks or special cases required), regardless of the underlying database type used. In addition, almost no field names are hard-coded, allowing for unlimited flexibility. Keep in mind that the terms database and database table actually mean the same thing in &IC; parlance - a database table. &IC; works with GDBM, DB_File, SQL, LDAP and in-memory types of databases. Regardless of the type, each database must be registered with &IC; before it's ready to be used, and this is achieved using the &conf-Database; configuration directive. Pay special attention to the fact that &conf-Database; is both catalog and global directive, indicating that you can share databases among catalogs. Three parameters needed to complete the &conf-Database; specification are an arbitrary database name, text source file with initial content, and the type of database.
Text Source Files Text source files are not databases themselves, of course (for performance and other reasons); they are only used to provide initial data for the corresponding database tables. By default, all database source files are kept in the products/ subdirectory of your &glos-CATROOT;. The &conf-ProductDir; directive controls the exact location. Database updates It is important to note that, when using &IC; internal database methods (which are some variant of DB_File or DBM, depending on what's available on your system), changes to text files cause databases to be resynchronized with plaintext file contents. This behavior can be controlled via the &conf-NoImport; config directive, but by default, changes in text files will trigger a rewrite of DBM or DB_File databases. This might lead to unexpected problems if you edit databases from &IC; and don't sync files with the databases first, or have a larger data sets (say, over a few thousand records) which take noticeable time to get re-imported.
SQL Databases As hinted above, you do not need to use an external SQL database. If you only have a small data set, you could use Interchange's internal databases. This is a tremendeous gain for small and quick setups, or &IC; evaluation. However, some functions (order management, for example) will be slower and not as robust without an SQL database. SQL is strongly recommended for at least the state, country, orderline, transactions and userdb tables. Any other tables that will have programmed updates, such as inventory, are also best placed in SQL. Database performance Do not, however, fall in the jaws of premature optimisation, your worst enemy. If you plan on using Interchange Admin UI, you should make the additional effort of also configuring SQL databases and switching databases to it. Admin UI provides easy import routines for text files that should replace traditional FTP text-file uploads. Using SQL also makes your data sets easily available for integration with other applications. Speaking of the source files' behavior, if a file named table.sql is present in the same directory as table.txt, then database table will not be imported from the ASCII text source file. If there is no products.sql, the DBI/SQL import will happen once at &IC; startup or catalog reconfiguration time; Interchange will connect to the SQL database using the specified DSN (DNS is a standard DBI parameter meaning "Database Source Name"). The table, if it already exists, will be dropped using a line similar to DROP TABLE table. This will occur without warning, but &conf-NoImport; can be used to prevent it or otherwise change the default behavior. The table will then be created again. If there are any COLUMN_DEF specifications present in &gcf;, &ccf; or products/table.sql, they will be used in table specification (which is recommended for clean and correct database layout). If there aren't any, however, then the key (first field in the text file, by default) will be created with the type char(16), and all other fields will be created as char(128). This is very unfortunate, but the best &IC; can do without your help. Table creation statements will be written to the error.log along with, of course, any errors. From my experience, the most common mistake at this step is picking column names which happen to be reserved keywords in &MYSQL;. Once the &glos-database; (database table actually, remember we said "database" and "table" simply mean a "table" in &IC; parlance) is created, the text source file will be imported into it. For this step to succeed, data typing must be user-configured. In other words, if none is placed in a field, and the field in question is defined to be of numeric type, database import will not succeed; consequently, the problematic catalog won't configure successfully (it will be skipped) and it won't be available when &IC; starts up. For a complete discussion, please see the &conf-Database; configuration directive.
*DB* Databases By "*DB*" databases we primarily assume Berkeley (DB_File) and GNU DBM. Those database types usually work in a way that, on every client access, the appropriate database text source file is checked for being newer than the actual DB file itself. When it happens that it is, the database table is re-imported from the text source file. For a complete discussion, please see the &conf-Database; configuration directive.
Memory Databases Memory databases are used by default only if no database type is explicity specified, and there is no DB_File or gdbm found on the system. Otherwise they can be used for small but high-traffic tables. Keep in mind, however, that since their contents are not saved back to the text files, you'll want to either take care of the data export yourself, or keep the tables stuffed with read-only data. As with SQL databases, the import will only be performed once at &IC; startup or catalog reconfiguration time. For a complete discussion, please see the &conf-Database; configuration directive.
1.1 xmldocs/refs/Database rev 1.1, prev_rev 1.0 Index: Database =================================================================== __NAME__ purpose register existing database table for use with Interchange __END__ __NAME__ synopsis name source_file type __END__ __NAME__ see also TableRestrict,data,DatabaseDefault __END__ __NAME__ description The directive registers a database table for use with &IC;. name specifies an arbitrary name — name that will be used to refer to the table within &IC;. Names can be composed of alphanumeric characters including underscore, and we recommend they're in all lower- or upper-case. source_file specifies the initial database source file, and type specifies its format. For more about &IC; and databases, and supported formats, see &glos-database; glossary entry. __END__ __NAME__ notes In &IC;, words table and database are used to refer to the same thing — database table. __END__ __NAME__ example: Default, most basic products database Database products products.txt TAB __END__ __NAME__ example: Simple definition of a CSV-style database source format Database reviews reviews.txt CVS __END__ 1.1 xmldocs/refs/NoImport rev 1.1, prev_rev 1.0 Index: NoImport =================================================================== __NAME__ purpose do not re-import text source files to databases unless the database disappears __END__ __NAME__ synopsis table_name __END__ __NAME__ description The directive specifies &glos-database; tables that should not be re-imported from the text source files, unless the database disappears (for example, if the table.gdbm is deleted). __END__ __NAME__ example: Disabling 'products' table import Put the following in &gcf;: NoImport products __END__ From docs at icdevgroup.org Sun Apr 10 18:45:56 2005 From: docs at icdevgroup.org (docs@icdevgroup.org) Date: Sun Apr 10 18:46:01 2005 Subject: [docs] xmldocs - docelic modified glossary/database Message-ID: <200504102245.j3AMjuZn022850@icdevgroup.org> User: docelic Date: 2005-04-10 22:45:56 GMT Modified: glossary database Log: More documentation ported from icdatabase.sdf Revision Changes Path 1.2 +159 -14 xmldocs/glossary/database rev 1.2, prev_rev 1.1 Index: database =================================================================== RCS file: /var/cvs/xmldocs/glossary/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 10 Apr 2005 22:45:56 -0000 1.2 @@ -49,25 +49,71 @@ By default, all database source files are kept in the products/ subdirectory of your &glos-CATROOT;. The &conf-ProductDir; directive controls the exact location. + +The ASCII files can have +^M (carriage return) characters, but must have a +newline character at the end of the line to work. +Mac users uploading files must use ascii mode, not binary mode. + + +Interchange's default ASCII delimiter is TAB. Keep in +mind that the items must be separated by a single delimiter (that is, a single +TAB by default). Due to the nature of TABs, TAB-delimited files +look messy and unaligned when viewed in a text editor. Do not try to fix these; +better use the te utility that comes as part of the +&IC; distribution to edit files more conveniently. + +Format examples: + + + TAB-delimited file: +Fields are separated by TAB characters. No whitespace is allowable +at the beginning of the line. + +code description price image +SH543 Men's fine cotton shirt 14.95 shirts.jpg + + +Using the default TAB delimiter is recommended if you plan on +searching the ASCII source file of the database. + - -Database updates + + PIPE-delimited file: +Fields are separated by the pipe ("|") characters which +resemble vertical lines. No whitespace is allowable at the beginning of the +line. + + +code|description|price|image +SH543|Men's fine cotton shirt|14.95|shirts.jpg + -It is important to note that, when using &IC; internal database methods -(which are some variant of DB_File or DBM, depending on what's available -on your system), changes to text files cause databases to be resynchronized -with plaintext file contents. - -This behavior can be controlled via the &conf-NoImport; config directive, -but by default, changes in text files will trigger a -rewrite of DBM or DB_File databases. This might lead to unexpected problems -if you edit databases from &IC; and don't sync files -with the databases first, or have a larger data sets -(say, over a few thousand records) which take noticeable time to get -re-imported. +PIPE-delimited files perform fairly well with ASCII text searching routines. + + + CVS-delimited file: +Fields are enclosed in quotes and separated by commas. Again, no whitespace +should be at the beginning of the line. + + +"code","description","price","image" +"SH543","Men's fine cotton shirt","14.95","shirts.jpg" + + +CSV-delimiter schemes might cause problems with ASCII text searching routines. + + + + + +Field names are usually case-sensitive. Use +consistency when naming or you might encounter problems. All lower or +all upper case names are recommended. +
@@ -155,7 +201,25 @@ actual DB file itself. When it happens that it is, the database table is re-imported from the text source file. + + +Database updates + +It is important to note that, when using &IC; internal database methods +(which are some variant of DB_File or DBM, depending on what's available +on your system), changes to text files cause databases to be resynchronized +with plaintext file contents. +This behavior can be controlled via the &conf-NoImport; config directive, +but by default, changes in text files will trigger a +rewrite of DBM or DB_File databases. This might lead to unexpected problems +if you edit databases from &IC; and don't sync files +with the databases first, or have a larger data sets +(say, over a few thousand records) which take noticeable time to get +re-imported. + + + For a complete discussion, please see the &conf-Database; configuration directive. @@ -180,5 +244,86 @@
+
+ Interchange Database Conventions + +This section describes naming and file usage conventions used with +&IC;. This is very important for both understanding &IC; and developing +your own custom solutions which build upon officially recommended practices. + +Term definitions: + + + + key or code + + The words reference the database key. In &IC;, the key is usually the + product code or &glos-SKU;, which is the product + part number. Otherwise, key values may be used to generate relationships + to other database tables. + + It is recommended that the key be the first column of the database + text source file, since Interchange's import, export, and search + facilities rely on this practice. + + + + field or column + + The vertical row of a database. One of the columns is always the key + and it is usually the first one, as explained above. + + + + table or database + + A table in the database. Because &IC; has evolved from a + single-table database to an access method for an unlimited number of + tables (and databases, for that matter), a table will occasionally be + referred to as a database. The only time the term database refers to + something different is when describing the concept as it relates to + SQL, where a database contains a series of tables. While &IC; + cannot create SQL databases, it can drop and create tables with that + database if given the proper permissions. + + + + + + + &IC; uses one mandatory database, which is referred to as the + products database. In the supplied catalog, the + database is directly called products + and the ASCII source is kept in the file products.txt + This is also the default file for searching contents with + the search engine, such as Glimpse or HTDig. + + Interchange also has a two of standard, but optional, databases that + are in fixed formats: + + + + + shipping.asc database contains shipping options that are + accessed if the &conf-CustomShipping; directive is in use. + This is a fixed-format database, and must be created as specified. + For more information, see &glos-shipping; glossary entry and the + &tag-shipping; tag. + + + + salestax.asc database contains + sales tax information if the &tag-salestax; tag is to + be used. A default is supplied. + Caution, these things change and need + periodic updating! See &glos-tax; glossary entry for more + information. + + + + + The two above tables are never stored in SQL or DBM. + +
From docs at icdevgroup.org Thu Apr 21 20:09:39 2005 From: docs at icdevgroup.org (docs@icdevgroup.org) Date: Thu Apr 21 20:09:44 2005 Subject: [docs] xmldocs - docelic modified 3 files Message-ID: <200504220009.j3M09dZn008757@icdevgroup.org> User: docelic Date: 2005-04-22 00:09:39 GMT Modified: glossary SKU database Modified: refs TAXSHIPPING Log: - Some more stuff ported from old docs, and few minor fixes Revision Changes Path 1.3 +1 -0 xmldocs/glossary/SKU rev 1.3, prev_rev 1.2 Index: SKU =================================================================== RCS file: /var/cvs/xmldocs/glossary/SKU,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SKU 15 Dec 2004 14:24:00 -0000 1.2 +++ SKU 22 Apr 2005 00:09:39 -0000 1.3 @@ -0,0 +1 @@ +Stock Keeping Unit. 1.3 +127 -14 xmldocs/glossary/database rev 1.3, prev_rev 1.2 Index: database =================================================================== RCS file: /var/cvs/xmldocs/glossary/database,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- database 10 Apr 2005 22:45:56 -0000 1.2 +++ database 22 Apr 2005 00:09:39 -0000 1.3 @@ -27,7 +27,7 @@ parlance - a database table. -&IC; works with GDBM, DB_File, SQL, LDAP and in-memory types of databases. +&IC; works with &GDBM;, DB_File, SQL, LDAP and in-memory types of databases. Regardless of the type, each database must be registered with &IC; before it's ready to be used, and this is achieved using the &conf-Database; configuration directive. Pay special attention to the fact that &conf-Database; is both @@ -57,8 +57,8 @@ Interchange's default ASCII delimiter is TAB. Keep in -mind that the items must be separated by a single delimiter (that is, a single -TAB by default). Due to the nature of TABs, TAB-delimited files +mind that the items must be separated by a single delimiter (that is, by a +single TAB only). Due to the nature of TABs, TAB-delimited files look messy and unaligned when viewed in a text editor. Do not try to fix these; better use the te utility that comes as part of the &IC; distribution to edit files more conveniently. @@ -108,8 +108,9 @@ -Field names are usually case-sensitive. Use -consistency when naming or you might encounter problems. All lower or +Field names are usually case-sensitive (in fact, that depends on the +underlying database type). Always be consistent when +naming or referencing fields and you'll avoid the trouble. All lower or all upper case names are recommended. @@ -136,7 +137,8 @@ Database performance -Do not, however, fall in the jaws of premature optimisation, your worst enemy. +Do not, however, try to optimize too soon and for no measureable difference. +Do not fall in the jaws of premature optimisation, your worst enemy. @@ -154,7 +156,8 @@ in the same directory as table.txt, then database table will not be imported from the ASCII text source file. -If there is no products.sql, the DBI/SQL import will happen once at +If there is no table.sql, +the DBI/SQL import will happen once at &IC; startup or catalog reconfiguration time; Interchange will connect to the SQL database using the specified DSN (DNS is a standard DBI parameter meaning "Database Source Name"). @@ -193,10 +196,10 @@
- *DB* Databases + File-based Databases -By "*DB*" databases we primarily assume Berkeley (DB_File) and GNU DBM. Those -database types usually work in a way that, on every client access, the +By file-based databases we primarily assume Berkeley (DB_File) and GNU DBM. +Those database types usually work in a way that, on every client access, the appropriate database text source file is checked for being newer than the actual DB file itself. When it happens that it is, the database table is re-imported @@ -220,6 +223,21 @@ +To check if you have &GDBM; and GDBM &PERL; support available, run +perl -le'require GDBM_File and print "I have GDBM."'. +To check if you have &BDBM; and DBM &PERL; support available, run +perl -le'require DB_File and print "I have Berkeley DB."'. +Sometimes you want to use &BDBM; even if &GDBM; is installed and would +naturally take precedence; in such cases, set the +MINIVEND_DBFILE environment variable to a true value +(setenv MINIVEND_DBFILE 1 in csh, +MINIVEND_DBFILE=1 ; export MINIVEND_DBFILE in +sh, +b(a)sh or +ksh). +It is also possible to use &BDBM; for just specific databases. + + For a complete discussion, please see the &conf-Database; configuration directive. @@ -228,15 +246,28 @@
Memory Databases +Memory &IC; databases +use &PERL; hashes to store the data directly in memory. Every time +the &IC; server is restarted, it will re-import all in-memory +databases for every catalog. + + Memory databases are used by default only if no database type is explicity specified, and there is no DB_File or gdbm found on the system. Otherwise they can be used for small but high-traffic tables. Keep in mind, however, that since their contents are not saved back to the text files, you'll want to either take care of the data export yourself, or keep the tables stuffed with read-only data. - -As with SQL databases, the import will only be performed once at -&IC; startup or catalog reconfiguration time. + + +if you want to force memory databases despite of GDBM_File or DB_File +being present, set the MINIVEND_NODBM environment variable +to a true value (look above for hints). +It is also possible to use memory type for just specific databases. + + +Memory databases import will be performed once at +every &IC; startup or catalog reconfiguration time. For a complete discussion, please see the &conf-Database; configuration directive. @@ -297,7 +328,10 @@ and the ASCII source is kept in the file products.txt This is also the default file for searching contents with the search engine, such as Glimpse or HTDig. - + + + + Interchange also has a two of standard, but optional, databases that are in fixed formats: @@ -324,6 +358,85 @@ The two above tables are never stored in SQL or DBM. + + +
+ "Products" Database + + The products databases contain items that + you're selling. + Each product listed should be given a product code, usually + referred to as &glos-SKU; — a short code that identifies the + product on the + ordering page and in the catalog. The products.txt + file is an ASCII-delimited text source file. It should contain + product SKUs, along with an arbitrary + number of fields which must contain at least the fields + description and + price (or however the + &conf-PriceField; and &conf-DescriptionField; + directives have been set). Any additional information needed in the + catalog can be placed in any arbitrary field. + + + The field names must be defined on the first line of the + products.txt file. These field names must match + exactly the field + names of the item-field tags in the catalog pages, or the + &IC; server will not access them properly. Field names can + contain the characters A-Za-z0-9 and underscore + (_). + + + It is important to adjust the &conf-PriceField; and &conf-DescriptionField; + directives appropriately if you change the default field names, or + &IC; tags such as item-price or item-description + won't work. + + + For each product entry in the text source file, the product code must + be the first field in the line, and + must be unique. Product codes can contain the characters + A-Za-z0-9, + along with hyphens (-), underscores + (_), pound signs/hash marks + (#), slashes (/) and periods + (.). Note that slashes will + interfere with on-the-fly page references; avoid them if at all possible. + + + The columns in text source files should be separated by one of the + approved delimiting + schemes (TAB, PIPE, or CSV), and are case-sensitive in some cases. If + the case of the "description" or "price" fields have been modified, + the &conf-PriceField; and &conf-DescriptionField; directives must be + adjusted appropriately. + + + + CSV format is not recommended as the scheme for the products + database. It is much slower than TAB- or PIPE-delimited files, and + dramatically reduces search engine functionality. No field-specific + searches are possible. Using CSV for any small database that will not + be searched is fine. + + + + More than one database may be used as a products database. If the + &conf-ProductFiles; directive is set to a space-separated list of + valid &IC; database identifiers, all listed databases will be + searched (in the order specified) for any items that are ordered, or + for product information (such as with price code or + field code + tags). + + + If you are modifying the database on-the-fly, it is recommended that + the file + be locked while it is being modified. Interchange's supplied import + routines do this. + +
1.2 +1 -1 xmldocs/refs/TAXSHIPPING rev 1.2, prev_rev 1.1 Index: TAXSHIPPING =================================================================== RCS file: /var/cvs/xmldocs/refs/TAXSHIPPING,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TAXSHIPPING 3 Jan 2005 20:42:16 -0000 1.1 +++ TAXSHIPPING 22 Apr 2005 00:09:39 -0000 1.2 @@ -25,7 +25,7 @@ __NAME__ example: -NV, IL +Variable TAXSHIPPING NV, IL __END__ From docs at icdevgroup.org Fri Apr 22 07:37:05 2005 From: docs at icdevgroup.org (docs@icdevgroup.org) Date: Fri Apr 22 07:37:10 2005 Subject: [docs] xmldocs - docelic modified refs/init_page/example2 Message-ID: <200504221137.j3MBb5Zn022930@icdevgroup.org> User: docelic Date: 2005-04-22 11:37:04 GMT Added: refs/init_page example2 Log: Little fixes, more examples Revision Changes Path 1.1 xmldocs/refs/init_page/example2 rev 1.1, prev_rev 1.0 Index: example2 =================================================================== Auto-wrapping pages in templates, deciding about a template depending on page path In this real-life example, we want to automatically attach header and footer to every served page. We also have four different templates, and want to include them depending on the path of the page being served. {last_url} =~ m#^/www(/|$)# ) { $tmpl = "www" } elsif ( $Session->{last_url} =~ m#^/plus(/|$)# ) { $tmpl = "plus" } elsif ( $Session->{last_url} =~ m#^/hp(/|$)# ) { $tmpl = "hp" } elsif ( $Session->{last_url} =~ m#^/adm(/|$)# ) { $tmpl = "adm" } $Scratch->{subsite} = $tmpl || $Scratch->{subsite} || "plus"; $$pref = "[include templates/$Scratch->{subsite}-top]" . $$pref . "[include templates/$Scratch->{subsite}-bottom]"; return; } EOS ]]> Note that we explicitly check for supported template types (www, plus, hp or adm) to minimize the chance of abuse. Invalid or unmatched templates default to the previously used template, or plus as a bottom line and the files templates/plus-top and templates/plus-bottom are included then. You might wonder in what cases would the code fail to match the template? Well, obviously, users could simply try to access non-existent pages. The other common issue are &glos-form-action;s such as /scan or /process. From docs at icdevgroup.org Sun Apr 24 06:54:39 2005 From: docs at icdevgroup.org (docs@icdevgroup.org) Date: Sun Apr 24 06:54:43 2005 Subject: [docs] xmldocs - docelic modified refs/form-session-id Message-ID: <200504241054.j3OAsdZn024434@icdevgroup.org> User: docelic Date: 2005-04-24 10:54:39 GMT Added: refs form-session-id Log: - Document form-session-id Revision Changes Path 1.1 xmldocs/refs/form-session-id rev 1.1, prev_rev 1.0 Index: form-session-id =================================================================== __NAME__ purpose insert hidden form field containing the session ID __END__ __NAME__ synopsis __END__ __NAME__ description It is necessary to include the &IC; session ID on &glos-HTML; forms when users are not accepting cookies, or they might lose the session information. The form-session-id tag inserts the appropriate hidden form field containing session ID on a page, but only when necessary. In most cases, the tag will insert the hidden form field (that is, when users are not accepting cookies or public display of session IDs — no_session_id — is not disabled). It will not, however, insert the field if the user is accepting browser cookies and no_session_id is enabled. __END__ __NAME__ example: Simple form with an optional session ID form field Here's a very simple login form. As you can see, all you have to do to include the session ID on the form is to include form-session-id somewhere in it. [form-session-id] [L]Username[/L]:
[L]Password[/L]:
]]>
__END__ From docs at icdevgroup.org Sat Apr 30 18:56:53 2005 From: docs at icdevgroup.org (docs@icdevgroup.org) Date: Sat Apr 30 18:56:59 2005 Subject: [docs] xmldocs - docelic modified 11 files Message-ID: <200504302256.j3UMurZn029886@icdevgroup.org> User: docelic Date: 2005-04-30 22:56:53 GMT Modified: glossary ITL Modified: refs bar-button base-url.tag button capture_page cart Modified: catch.tag cgi.tag convert-date.tag counter.tag Added: refs br.tag Log: Little fixes, some more docs, nice series altogether. Revision Changes Path 1.10 +4 -2 xmldocs/glossary/ITL rev 1.10, prev_rev 1.9 Index: ITL =================================================================== RCS file: /var/cvs/xmldocs/glossary/ITL,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ITL 6 Mar 2005 11:51:28 -0000 1.9 +++ ITL 30 Apr 2005 22:56:52 -0000 1.10 @@ -341,7 +341,9 @@ reparse attributes here. It is very important to remember that the behavior of the interpolate attribute (unfortunately) differs, -depending on whether a tag is stand-alone or a container. In addition, +depending on whether a tag is stand-alone or a +container. +In addition, the reparse attribute is only used with container tags (because its function is performed by interpolate in stand-alone tags). @@ -352,7 +354,7 @@ specifies whether the tag body will be &glos-interpolate;d before being passed to the tag. -With stand-alone tags, the interpolate attribute +With non-container tags, the interpolate attribute specifies whether the output of the tag will be &glos-interpolate;d. This is very confusing because it's not intuitive, but once you get to remember it a few times in practice, it will stop being a 1.6 +2 -1 xmldocs/refs/bar-button rev 1.6, prev_rev 1.5 Index: bar-button =================================================================== RCS file: /var/cvs/xmldocs/refs/bar-button,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- bar-button 14 Dec 2004 19:15:43 -0000 1.5 +++ bar-button 30 Apr 2005 22:56:53 -0000 1.6 @@ -23,7 +23,8 @@ Name of the current page. Usually you do not want to override the default. - +&ROW_INTERPOLATE_0; +&ROW_REPARSE_1; __END__ 1.3 +0 -1 xmldocs/refs/base-url.tag rev 1.3, prev_rev 1.2 Index: base-url.tag =================================================================== RCS file: /var/cvs/xmldocs/refs/base-url.tag,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- base-url.tag 8 Mar 2005 11:43:13 -0000 1.2 +++ base-url.tag 30 Apr 2005 22:56:53 -0000 1.3 @@ -9,7 +9,6 @@ __NAME__ synopsis &ROW_INTERPOLATE_0; -&ROW_REPARSE_1; __END__ 1.10 +7 -0 xmldocs/refs/button rev 1.10, prev_rev 1.9 Index: button =================================================================== RCS file: /var/cvs/xmldocs/refs/button,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- button 14 Dec 2004 19:15:43 -0000 1.9 +++ button 30 Apr 2005 22:56:53 -0000 1.10 @@ -91,11 +91,18 @@ &ROW_EXTRA_none; &ROW_HTML_std; &ROW_CSS_std; +&ROW_INTERPOLATE_0; +&ROW_REPARSE_1; __END__ __NAME__ see also env +__END__ + + +__NAME__ notes +The &tag-button; tag can work with unnamed forms. __END__ 1.9 +1 -0 xmldocs/refs/capture_page rev 1.9, prev_rev 1.8 Index: capture_page =================================================================== RCS file: /var/cvs/xmldocs/refs/capture_page,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- capture_page 14 Dec 2004 19:15:43 -0000 1.8 +++ capture_page 30 Apr 2005 22:56:53 -0000 1.9 @@ -62,6 +62,7 @@ &ROW_UMASK_none; &ROW_HIDE_0; +&ROW_INTERPOLATE_0; __END__ __NAME__ description 1.3 +6 -0 xmldocs/refs/cart rev 1.3, prev_rev 1.2 Index: cart =================================================================== RCS file: /var/cvs/xmldocs/refs/cart,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- cart 14 Dec 2004 19:15:43 -0000 1.2 +++ cart 30 Apr 2005 22:56:53 -0000 1.3 @@ -34,6 +34,10 @@ nitems). __END__ +__NAME__ notes +See the &glos-cart; glossary entry. +__END__ + __NAME__ example: Set new default cart name Place the following on an Interchange page: @@ -41,3 +45,5 @@ __END__ +__NAME__ see also +__END__ 1.3 +6 -19 xmldocs/refs/catch.tag rev 1.3, prev_rev 1.2 Index: catch.tag =================================================================== RCS file: /var/cvs/xmldocs/refs/catch.tag,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- catch.tag 8 Mar 2005 18:15:51 -0000 1.2 +++ catch.tag 30 Apr 2005 22:56:53 -0000 1.3 @@ -100,25 +100,7 @@ - - - - hide - - - - - - - - - - - - - - - +&ROW_HIDE_0; &ROW_INTERPOLATE_0; &ROW_REPARSE_1; __END__ @@ -190,3 +172,8 @@ __END__ + + +__NAME__ missing +description for exact, joiner, error_set, error_scratch options +__END__ 1.5 +1 -0 xmldocs/refs/cgi.tag rev 1.5, prev_rev 1.4 Index: cgi.tag =================================================================== RCS file: /var/cvs/xmldocs/refs/cgi.tag,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- cgi.tag 14 Dec 2004 19:15:43 -0000 1.4 +++ cgi.tag 30 Apr 2005 22:56:53 -0000 1.5 @@ -60,6 +60,7 @@ &ROW_FILTER_none; &ROW_HIDE_0; +&ROW_INTERPOLATE_0; __END__ 1.2 +33 -2 xmldocs/refs/convert-date.tag rev 1.2, prev_rev 1.1 Index: convert-date.tag =================================================================== RCS file: /var/cvs/xmldocs/refs/convert-date.tag,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- convert-date.tag 17 Feb 2005 23:25:39 -0000 1.1 +++ convert-date.tag 30 Apr 2005 22:56:53 -0000 1.2 @@ -2,6 +2,28 @@ + + adjust + days + + + + Yes + + + + + + + + + + + + + + + raw @@ -21,7 +43,10 @@ - format + + format + fmt + @@ -77,4 +102,10 @@ &ROW_INTERPOLATE_0; &ROW_REPARSE_1; -__END__ \ No newline at end of file +__END__ + + +__NAME__ missing +option descriptions +__END__ + 1.2 +352 -225 xmldocs/refs/counter.tag rev 1.2, prev_rev 1.1 Index: counter.tag =================================================================== RCS file: /var/cvs/xmldocs/refs/counter.tag,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- counter.tag 17 Feb 2005 23:25:39 -0000 1.1 +++ counter.tag 30 Apr 2005 22:56:53 -0000 1.2 @@ -1,232 +1,359 @@ __NAME__ synopsis - - start - - - - - - - - - - - - - - - - - - - sql - - - - - - - - - - - - - - - - - - - inc_routine - - - - - - - - - - - - - - - - - - - bypass - - - - - - - - - - - - - - - - - - - dsn - - - - - - - - - - - - - - - - - - - user - - - - - - - - - - - - - - - - - - - pass - - - - - - - - - - - - - - - - - - - attr - - - - - - - - - - - - - - - - - - - date - - - - - - - - - - - - - - - - - - - dec_routine - - - - - - - - - - - - - - - - - - - value - - - - - - - - - - - - - - - - - - - decrement - - - - - - - - - - - - - + + + name + file + + + + Yes + + + + + + &glos-CATROOT;/etc/counter + + + Counter file to use. Taken relatively to &glos-CATROOT; unless absolute + pathname is specified. + + + + + + + start + + + + + + + + + + + + Counter start value + + + + + + + sql + + + + + + + + + + + + A table:field specification, if &tag-counter; is to increment a field in an SQL database. + + + + + + + inc_routine + + + + + + + + + + + + Routine to use to increase the counter. + The routine should be an + existing &PERL; function, catalog subroutine, or global subroutine + + + + + + + bypass + + + + + + + + + 0 + + + Bypass the existing database connection, and instead connect to the database + anew, if sql attribute is used. + + + + + + + dsn + + + + + + + + + DBI_DSN + + + DSN information to connect to the SQL database, if + sql attribute is used + + + + + + + user + + + + + + + + + + + + User to connect to the database as, if + sql attribute is used + + + + + + + pass + + + + + + + + + + + + Password to provide during connection to the database, if + sql attribute is used + + + + + + + attr + + + + + + + + + + + + Extra content for the DBI->connect call + + + + + + + date + + + + + + + + + + + Date-based counter? Set to any true value, or gmt to + also signify GMT date + + + + + + + dec_routine + + + + + + + + + + + + Routine to use to decrease the counter + The routine should be an + existing &PERL; function, catalog subroutine, or global subroutine + + + + + + + value + + + + + + + + + + + + Literal value to set counter to + + + + + + + decrement + + + + + + + + + 0 + + + Decrement instead of incrementing the counter? + &ROW_INTERPOLATE_0; &ROW_REPARSE_1; -__END__ \ No newline at end of file +__END__ + + +__NAME__ description +The tag provides an interface to the counter functionality within &IC;. +The counters are usually kept as text files, but can also be sequences in +&glos-SQL; tables. +
+&tag-counter; can increase and decrease counters, or set them to specific +values. In addition, custom increment or decrement functions can be +used. +__END__ + + +__NAME__ notes +The SQL field-updating routine is database-dependent; please see the tag +source for details. + +Date-based counters cannot be decremented. +__END__ + +__NAME__ example: Basic counter file +The following creates a counter file, +counter.basic in your catalog root directory. +The counter starts at 10. + +[counter file=counter.basic start=10] + +__END__ + + +__NAME__ example: Basic date-based counter file +The following creates two date-based counter files, +counter.loc and +counter.gmt in your catalog root directory. + +[counter file=counter.loc date=1] +[counter file=counter.gmt date=gmt] + +__END__ + + + +__NAME__ example: Counter using steps of +2 and -2, with in-place subroutine specification +The following creates two counter files, +counter.p2 and +counter.m2 in your catalog root directory. +Counters initially start at 20; one adds +2 and one subtracts 2 each time +they're called. + +[counter + file=counter.p2 + start=20 + inc-routine=`sub { shift(@_) + 2 }` +] +[counter + file=counter.m2 + start=20 + decrement=1 + dec-routine=`sub { shift(@_) - 2 }` +] + +__END__ + + + +__NAME__ example: Counter using steps of +3 and -3, with Sub or GlobalSub routine specification +The following creates two counter files, +counter.p3g and +counter.m3g in your catalog root directory. +Counters initially start at 20; one adds +3 and one subtracts 3 each time +they're called. + +You need the following in &ccf; or &gcf;: + + +And the following on an &IC; page: + +[counter file=counter.p3 start=20 inc-routine=three_steps_forward ] +[counter file=counter.m3 start=20 decrement=1 dec-routine=three_steps_back] + +__END__ + 1.1 xmldocs/refs/br.tag rev 1.1, prev_rev 1.0 Index: br.tag =================================================================== __NAME__ purpose insert HTML BR (break) element __END__ __NAME__ see also __END__ __NAME__ synopsis &ROW_INTERPOLATE_0; __END__ __NAME__ description The tag simply inserts the &glos-HTML; BR (break) element. The tag is lowercased and, if the Vend::Xtrailer variable is set, terminated with / to satisfy XHTML convention. __END__ __NAME__ example: Inserting HTML BR Line 1[br] Line 2[br] __END__