Permalink
Browse files

* Improved table-editor attribute listing

* A few simpler formatting/text fixes to a few files
  • Loading branch information...
docelic committed Aug 9, 2008
1 parent 8d17e07 commit cdf770d6d6342bed71a26eb75be449e95a327292
Showing with 186 additions and 93 deletions.
  1. +1 −0 TODO
  2. +4 −4 guides/howtos.xml
  3. +7 −2 guides/search.xml
  4. +12 −7 refs/AutoVariable
  5. +21 −0 refs/checked.tag
  6. +1 −1 refs/convert-date.tag
  7. +99 −63 refs/db_columns.tag
  8. +1 −1 refs/discount
  9. +40 −15 refs/table-editor.tag
View
1 TODO
@@ -6,6 +6,7 @@
- see if the files we parse in bin/stattree in block (like parseVendConfig, parseVendInterpolate) allow some stuff to go unaccounted for mkreport
- with tags from Interpolate.pm, context for systemtag is not always 'whole file', but can be x-y as well
- dal autogen preskoci kontekst koji je prazan? i zasto uopce unkondicionalno
+- rijesit html_std/_ext i opcije
ekspandira @$ctx ako moze da nema konteksta?
- make howtos chunk
- fix link to howtos after changing format
View
@@ -936,7 +936,7 @@ or
- <qandaentry><question><para>
+ <qandaentry id=""><question><para>
Creating custom search routines for use in mv_column_op
</para></question><answer><para>
It is possible to define your own search functions that can be
@@ -967,15 +967,15 @@ or
</para></answer></qandaentry>
- <qandaentry><question><para>
+ <qandaentry id="text_query"><question><para>
Supporting AND, OR, and other advanced search specifications
</para></question><answer><para>
You can install <classname>Text::Query</classname> Perl module
to enable advanced query parsing for search specifications.
</para><para>
To use <classname>Text::Query</classname>, set <mv>mv_column_op</mv>
- to <literal>aq</literal> for advanced parsing or
- <literal>tq</literal> for simple parsing.
+ to "<literal>aq</literal>" for advanced parsing or
+ "<literal>tq</literal>" for simple parsing.
</para><para>
To learn about the features "<literal>aq</literal>" and
"<literal>tq</literal>" give you, see
View
@@ -204,9 +204,14 @@ Now you can start indexing with <literal>swish-e -S prog -c
</section>
<section id="mv_column_op"><title>
<literal>op &mdash; mv_column_op</literal></title><cmdsynopsis>
- (<literal></literal>/<literal></literal>,
- default <literal></literal>)</cmdsynopsis><para>
+ (<literal>rm</literal> | <literal>eq</literal> |
+ <literal>tq</literal> | <literal>aq</literal>,
+ default <literal>rm</literal>)</cmdsynopsis><para>
operation to perform to check field for a match.
+ </para><para>
+ For <literal>tq</literal> and <literal>aq</literal> matching
+ using <classname>Text::Query</classname> module, see
+ <olink targetdoc="howtos" targetptr="text_query"/>.
</para>
</section>
<section id="mv_coordinate"><title>
View
@@ -12,16 +12,21 @@ __END__
__NAME__ description
-Specify list of &glos-configuration; directives that are to be automatically
-created as variable/value pairs. This allows you to conveniently
-write say, <code>__<replaceable>DIRECTIVENAME</replaceable>__</code>, and
+Specify list of &glos-configuration; directives whose values are to be made
+available through the &glos-variable; space.
+This allows you to conveniently
+write say, <code>__<replaceable>DirectiveName</replaceable>__</code>, and
retrieve the corresponding configuration directive's value.
</para><para>
-The above example, however, only works for scalar values. Since &IC;
-also supports &glos-array;s and &glos-hash;es of values (so, all three
-basic &PERL; types), the syntax had to be extended a little. With
-array or hashes, you need to append the index number or hash key respectively.
+To support &glos-scalar;s, &glos-array;s and &glos-hash;es of values (all
+three basic &PERL; types), the syntax had to be extended a little. With
+array or hash &glos-configuration; directives, you need to append the index
+number or hash key respectively.
See <xref linkend="AutoVariable_examples"/> for clarification.
+</para><para>
+Note that the behavior of &conf-__FILENAME__; is not dynamic &mdash; if need
+to re-invoke &conf-__FILENAME__; every time you want to "refresh" the
+value visible through <code>__<replaceable>DirectiveName</replaceable>__</code>.
__END__
View
@@ -148,6 +148,27 @@ __NAME__ description
The tag provides "memory" for &glos-HTML; checkboxes and radio buttons.
__END__
+__NAME__ example: "Memory" for checkboxes
+<programlisting><![CDATA[
+<pre>
+
+<form action="[process href="@@MV_PAGE@@"]" method="post">
+ [form-session-id]
+ <input type=hidden name=mv_todo value=refresh>
+
+ <input type=checkbox name=checkbox1 [checked name=checkbox1 cgi=1]> Option1
+ <input type=checkbox name=checkbox2 [checked name=checkbox2 cgi=1]> Option2
+ <input type=checkbox name=checkbox3 [checked name=checkbox3 cgi=1]> Option3
+ <input type=checkbox name=checkbox4 [checked name=checkbox4 cgi=1]> Option4
+ <input type=checkbox name=checkbox5 [checked name=checkbox5 cgi=1]> Option5
+
+ <input type=submit>
+</form>
+
+</pre>
+]]></programlisting>
+__END__
+
__NAME__ example: Radio Button
Displays a radio button and selects the second choice by default:
<programlisting><![CDATA[
View
@@ -62,7 +62,7 @@ __NAME__ synopsis
<literal>%d-%b-%Y</literal>
</entry>
<entry>
- format string
+ POSIX strftime format specifier; see &glos-time; glossary entry.
</entry>
</row>
View
@@ -1,10 +1,14 @@
+__NAME__ purpose
+retrieve column names from a database table
+__END__
+
__NAME__ synopsis
<row>
<entry>
- <group choice='plain'>
- <arg>name</arg>
- <arg>table</arg>
+ <group>
+ <arg choice='plain'>name</arg>
+ <arg choice='plain'>table</arg>
</group>
</entry>
<entry>
@@ -17,16 +21,16 @@ __NAME__ synopsis
<!-- DFL -->
</entry>
<entry>
- <!-- DSC -->
+ Name of the &glos-database; table.
</entry>
</row>
<row>
<entry>
- <group choice='plain'>
- <arg>fields</arg>
- <arg>columns</arg>
+ <group>
+ <arg choice='plain'>fields</arg>
+ <arg choice='plain'>columns</arg>
</group>
</entry>
<entry>
@@ -39,7 +43,7 @@ __NAME__ synopsis
<!-- DFL -->
</entry>
<entry>
- <!-- DSC -->
+ Manually specify columns to be returned.
</entry>
</row>
@@ -58,7 +62,8 @@ __NAME__ synopsis
<literal>\n</literal>
</entry>
<entry>
- <!-- DSC -->
+ String joiner to use if column list is requested in &PERL;
+ <literal>scalar</literal> context.
</entry>
</row>
@@ -74,69 +79,100 @@ __NAME__ synopsis
<!-- REQ -->
</entry>
<entry>
- <!-- DFL -->
+ 0
</entry>
<entry>
- <!-- DSC -->
+ With <literal>columns=</literal>, return columns in the
+ passed order instead of table order?
</entry>
</row>
-<row>
+&TAG_CONTAINER;
+__END__
- <entry>
- show_error
- </entry>
- <entry>
- <!-- POS -->
- </entry>
- <entry>
- <!-- REQ -->
- </entry>
- <entry>
- <!-- DFL -->
- </entry>
- <entry>
- <!-- DSC -->
- </entry>
+__NAME__ description
+&tag-__FILENAME__; returns the list of columns in a
+&glos-database; table.
+__END__
-</row>
-<row>
+__NAME__ notes
+A side effect of specifying <literal>passed_order=1</literal> is the
+removal of invalid column names from the <literal>columns=</literal>
+list; column names not present in the database table are filtered out,
+instead of being returned regardless.
+__END__
- <entry>
- keys
- </entry>
- <entry>
- <!-- POS -->
- </entry>
- <entry>
- <!-- REQ -->
- </entry>
- <entry>
- <!-- DFL -->
- </entry>
- <entry>
- <!-- DSC -->
- </entry>
+__NAME__ example: looping over column list from the products table
+<programlisting><![CDATA[
+<pre>
+[loop list="[db-columns products]"]
+ Column: [loop-code]
+[/loop]
+</pre>
+]]></programlisting>
+__END__
-</row>
-<row>
+__NAME__ example: looping over column list, without using db_columns
+It is possible to list table columns manually without the use of
+&tag-db_columns;. The output will be satisfactory as long as you don't
+need db_column's <literal>columns=</literal> attribute.
- <entry>
- joiner
- </entry>
- <entry>
- <!-- POS -->
- </entry>
- <entry>
- <!-- REQ -->
- </entry>
- <entry>
- <!-- DFL -->
- </entry>
- <entry>
- <!-- DSC -->
- </entry>
+<programlisting><![CDATA[
+[perl tables=products]
+ $Scratch->{columns} = join ' ', $Db{products}->columns;
+ return;
+[/perl]
-</row>
-&TAG_NON_CONTAINER;
+<pre>
+[loop list="[scratch columns]"]
+ Column: [loop-code]
+[/loop]
+</pre>
+]]></programlisting>
__END__
+
+
+
+
+
+
+From docelic at mail.inet.hr Thu Nov 4 17:16:15 2004
+From: docelic at mail.inet.hr (Davor Ocelic)
+Date: Thu Nov 4 17:16:31 2004
+Subject: [interchange-core] db_columns UI tag
+Message-ID: <20041104231615.2aee658c.docelic@mail.inet.hr>
+
+
+Hi,
+
+ The db_columns UI tag isn't documented so I can't compare the source
+ with intended behavior, but the tag has some problems:
+
+ In this code block:
+
+ if($passed_order) {
+ @col{@allcols} = @allcols;
+ @allcols = @cols;
+
+ my $found;
+ for(@cols) {
+ next unless $_ eq $key;
+ $found = 1;
+ last;
+ }
+#
+ unshift (@allcols, $key) if ! $found;
+ }
+
+
+Everything after the first line (@col{@allcols} = @allcols)
+ has no effect on the execution.
+
+ Besides, looks like the tag tries to ensure that $key is
+ always included in the set of returned column names, but
+ it doesn't succeed in doing so (at least if columns=
+ is specified by user).
+
+ Since the docs aren't available, I'd like someone more
+ familiar with this to check-in a fix if I'm right.
+
View
@@ -93,7 +93,7 @@ __END__
__NAME__ example: Resetting discounts
To reset a discount, simply set it to the empty string:
<programlisting>
-[discount ALL_ITEMS /]
+[discount ALL_ITEMS][/discount]
</programlisting>
__END__
Oops, something went wrong.

0 comments on commit cdf770d

Please sign in to comment.