A2E::Dokfs
This describes version 0.1.6
a2e multilingual hypertext file system library, used by many small programs, based on A2E::Daba and A2E::Lokvars, basis for A2E::Mktdir::* et al.
This "file system" is an abstraction layer on top of normal file systems. It should allow you to perform operations such as change, move, copy, delete etc on whole document nodes which comprise a rich set of metadata, rather just on files and directories.
It is a successor of the A2E::Dokfs library and thus already quite mature at version 0.0.1.
Search for 'BUGS' statements in some functions.
Functions like dok_pre_lng_faylz and rmdok should use whatever prefix is found to be in use in the concerned directory.
The same heuristics should be used to determine MPX in a2e/defs.mk and the like.
using the get_dok_plugins approach, retain only core functionality, move major parts out into mix-in libraries, built along the model of A2E::Lokvars. Turn the Mktdir libraries into mix-in libraries of this type.
Use Tinymake or the like to incorporate the makefile rules that are part of document creation. Turn calls of standalone programs into function calls.
Consider combination with Psh to create a Dokfs shell.
The document alias should be registered in a separate table with proper constraints, not in doktexts.
allow template-based document creation and handling, e.g.
mktdir0 -T oas_ont -V mm=04 -V aa=09 ont oas_ont0904 de zh
where variable document metadata are prestored in the template files /opt/a2e/share/tmpl/oas_ont_* and variable parts are transmitted via the -V expressions.
A2E::Daba(3)
A2E::Lokvars(3)
...
This describes version 0.1.6 of A2E::Dokfs.
Multilingual vocabulary lng.perllibdoku.txt should come before monolingual vocabulary lng.perllibdoku.de.txt
Traditionally it was the other way around. Starting from version 0.4.5 this is set to 1 in the local configuration file dokfs
File with lexical definitions that come before anything else. Suitable especially for numeric parameters on which decisions in templates and template vocabulary files are then based.
File with lexical definitions that come before anything else. Suitable especially for numeric parameters on which decisions in templates and template vocabulary files are then based.
default format of lexical definitions in the language neutral vocabulary file read at the end, using printf syntax with two arguments: variable name and variable value.
default format of lexical definitions in a pre-definition vocabulary file, using printf syntax with two arguments: variable name and variable value.
file naming template for template-related non-language-specific pre-vocabulary file
file naming template for template-related non-language-specific pre-vocabulary file
file naming template for template-related language-specific vocabulary file
file naming template for template-related non-language-specific post-vocabulary file. Placeholder 1 is the language.
filename format for configuration files templates, arg1 to be filled by $m->{tmpl}. This is appended to $m->{topdir}/$m->{topdok}_ or, when installing the latter, ${tmpldir}
regexps for matching 'sig_oas1312' into ('oas', '13', '12') whence '/sig/oas/13/12'
Using the dirurls variable and its inversion dirurls, we try to have as simple as possible mappings between the web path and the file system path on the one hand and the SVN path and file system path on the other:
a2e.de/sig/i2p/07/10 --> /sig/i2p/07/10 <-- /svn/sig_i2p0710/
a2e.de/index.html --> /a2e/index.html <-- /svn/a2e/index.html
eupat.ffii.org/07/10 --> /eupat/07/10 <-- /svn/eupat0710
inversion, derived from urldirs but can also be set manually.
inversion, derived from vihdoms but can also be set manually
inversion, is derived from urldirs but can also be set manually.
several ways of recognising a document, insertable and removable.
Date of the current document, in '2008-08-08' style notation. This should be the an unequivocal and largely immutable attribute, such as date of creation, the deadline of delivery. The value of the 'dokdatum' configuration variable can be overridden by the value of a template variable named 'dokdatum' or by the value of a template variable named by the value of a template variable named 'dokdatum_var'.
Date of latest version of (i.e. latest changes to) the current document.
news/rss channel from which the current document publishes news, scalar but with possibility of indicating several, separated by commas or spaces
news/rss channels into which the current document is inserted as a news item, scalar but with possibility of indicating several, separated by commas or spaces, and a possibility of attaching, after a colon, a degree of importance to each, with 0 representing normalcy and positive or negative integers representing increased or decreased degrees of importance respectively.
print only news items whose date is not earlier than the date given here. print even the earliest items if no date is specified.
print only news items whose date is smaller (at least 1 day earlier) than the date given here. print everything up to now if not specified.
Print maximally this number of documents per channel.
No limit if set to zero, which is the default.
Print only news items with priority level as indicated or higher.
When comparing, subtract 1 if the date is not of the current month, 2 if not of the current year.
Premium news have a rank of 3 when they are emitted. Setting news_level to 3 would mean that only premium news of the current month are allowed in this channel.
To set the level of importance of a particular news item use the --putkanals option.
OBSOLETE, now dynamic textchunk sems2subflat. Node group directory. Let the document be subordinate not to the node in its normal parent directory but to the node of the parallel directory indicated by the argument. The node group directory can be the current directory '.', in which case the document is created in a parallel directory under the parent directory. If the grpdir argument is empty, the document will be subordinate to the current document in the normal way, i.e. as a subdirectory.
To which document the headline of a particular channel should link
Which template variable should be used for the title of a particular channel
Which template variable should be used for the description of a particular channel
Limit of number of news items in a particular channel
Threshold of news for a particular channel
date at which the news of a particular channel should begin
dte before which the news of a particular channel should end
%s.news.%s.rss
format of name of rss file with args dok and lang
Establish the named document as a news channel. If the name is '1' or '*', use the current document identifier. If the name is '0' or empty, to not establish a news channel.
superordinate channel -- ancestor of which the current channel becomes a subordinate
date of establishment of channel
database tables in which a document (dok) is referenced
name of field within each table that references dok, if it is not called 'dok'.
Any subdocument will have the given scalar configuration variable set. Do not set --subopts tmpl, use subtmpl instead.
A way to specify in a local configuration file how the (simplified and restricted for a context) commandline should be read and transformed into internal variables, using the syntax of the mlht language. Experimental, see dok:tmpl090317
Never used, probably OBSOLETE.
Cache in memory any document data of any documents referenced in the text via dok2data. The speed gain will be worth the memory increase only when the documents are referenced repeatedly. On by default but it might be sensible to turn it off in the local configuration file of certain nodes.
text chunks that are not used as template variables when they come from an external document's vocabulary database (e.g. the parent of the actual document that we are creating with A2E::MKtdir).
Probably OBSOLETE.
regex matching the part of each pathname under which the subversion repository trees on the local harddisk begin. it is assumed to be surrounded by \A and \b, i.e. begin at the beginning of the pathname and end at a word border. This is consulted only in the rare cases where info cannot be directly collected from the local svn repository via the svn_info function, e.g. in cases where an application is run by Apache under identity of a user that has no svn access.
Deprecated, use textchunks of same names in @pre.$dok.txt or, even better, lang_pre.txt of document type instead.
top-level document of current web host where sitemap index is to be found. used by mktdir when creating a new top node, by sitemap_tmplfil when compiling a sitemap, and by the top node sitemap index form.
Maximal number of language columns juxtaposed to each other in the generated document. Default is 1, meaning that all resulting documents are monolingual.
E.g. if nlangkols
is 2 and the documents languages are de en zh ja, then we get one monolingual original and 3 bilingual versions:
de
de en
de zh
de ja
If nlangkols
is 3, we get
de
de en
de en zh
de en ja
1 monolingual, 1 two-column bilingual and 2 three-column trilingual versions.
This will work together with the litscat template macro of A2E::Template::Context, which in turn will invoke special macros like
*
so as to typeset text parts of each level in the specifically appropriate way, resulting in something like
* Chemische Verbindungen --- Chemical Compounds
| Karbide | Carbides | 碳化物 |
| Karbonate | Carbonates | 碳酸化合物 |
To make this work we create a hash pointer $m->{lang_tmplvars} which contains the language variables of several languages and make $m->{tmplvars} point to $m->{lang_tmplvars}->[$lang] where $lang refers to the current language. This has been tentatively done in &A2E::MLHT::mlht_set_langvars.
Whether the tmpltoks extension that will allow multilingual metadata to be written into a special table like 'flddes' is enabled yet. Set this on for debugging only at the moment.
Whether the poorly understood idelits accumulation functionality is to be used.
It is used only in A2E::Dok2data, see explanations listref idelits
.
Minimal smprior (search machine priority, two digit rational between 0 and 1) needed for a news item to be listed.
configuration: _dokfs, ~/dokfs.konf, /etc/opt/a2e/dokfs.konf
mktdir4(1)
A2E::Mktdir(3)
A2E::Daba(3)
A2E::Lokvars(3)
nav2html(1)
makedoksrow(1)
perl(1)
Hartmut Pilch
Copyright (c) 2007-8 Hartmut Pilch (phm)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To be done at startup in postkonfig.
args := lit2kol, kol2lit
lit2kol := string
lit2kol => 'lit2mlid'
kol2lit := string
kol2lit => 'mlid2lit'
rets := revers_map
The source map is found in $m->{cache}->{lit2kol} The target map is stored in $m->{cache}->{kol2lit}
How html file names are formed when a stem and a two-letter language code are given.
The Apache configuration may have to contain the same configuration information if content negotiation is to be used effectively.
Write a document- and language-specific tag and value to the database.
arg1 is the tag (mlid), arg2 the value (mltxt).
Overwritable fallback function that specifies how dir2dir works in case the base directory is not specified in the svnbas2dir configuration option
sig_oas, 08, 09 => /sig/oas/08/09
possibly belong to a lower layer
Escape text for use in html
Synopsis
$p->tmpltag({ TAG_STYLE => 'star', POST_CHOMP => '-' }, 'SET', 'dummy', '=', 1);
=> [* SET dummy = 1 -*]
$p->tmpltag('SET', 'dummy', '=', 2);
=> <% SET dummy = 2 %>
Arg 1 is an optional reference to a template options hash as described in Template::Manual::Config.
If arg 1 is not a reference, it is omitted and $m->{cache}->{tmplopts} is consulted instead.
Take an URL, return a list consisting of protocol, domain and the file path (as a list of directory parts and a final filename)
set the object field 'url_parts' to a reference to the list of values returned by url_parts
subroutine of reldir and relurl
Take an url and, if possible, reduce it to its url as seen from the current document $m->{dok}.
Example:
# $m->{dok} => 'a2e_css' , $m->dok2absurl($m->{dok}) = 'http://a2e.de/adv/css'
$m->relurl('http://a2e.de/adv/perl/A2E/Dokfs.pm')
# => ../perl/A2E/Dokfs.pm
The whole file path of the url given as argument, from the perspective of the current $m->{url}, starting from the web server\'s top directory.
Find info about my own url, derive further info from it and store it in me.
Collect and store some info that is needed for generating menus and other navigation help.
Make sure this is done only once.
read alias info from database into memory.
Write language-specific text variables into the langtxts table. These include the ones specified via 'special lit2mlid'. They no longger include language-specific extensions specified with tmpltoks because these are not document-specific and thus not written into table 'langtxts' but rather, after some more complicated mapping, 'flddes'.
$m->littups_put_db({ tit => 'hello world', sut => 'i am greeting you', des => 'my first try', lab => 'hello' }, 'en', 'phm_salut081224');
The contents of the hashref mandatory first argument is written to the database.
Further optional arguments specify the language and the document.
write subdocuments info into database
From a parent directory generate a hashref table that maps document names to directories
Read from database which document nodes are root nodes (topdoks), and store this info in the object $m as follows.
Any document node $dok that has no other node above itself is marked with $m->{topdoks}->{$dok} = 1.
Return the number of topdoks thus found.
This should come near the beginning of most programs that use A2E::Dokfs.
Many other routines depend on the info being set. Unless given a true first argument ($force), it returns without reading the database anew (in the topdoks_already_set block) if it finds that the topdoks info is already there.
Another method of finding out whether a given dok directory is at the top of a microsite is provided by function topinddokp.
return the final document identifier to which a chain of aliases may be pointing.
In the good old days of txt2html, we used to write [dok:a2edb_perl_pub], like a kind of URL in analogy for [http://a2e.de/adv/perl/A2E].
This is poorly documented and mostly unused now because we are relying on a more programmable formatter, deplate, which encourages different solutions.
dok: registered document identifier fol: leaf, file which is found in the directory
Used in generating menus
These are needed by menu-generating programs such as nav2html and makedoksrow.
Get a chunk of text, specifying the mlid (identifier, e.g. 'label') and optionally dok, lang and uid. Usually the latter three are preset.
convert 'lab' to 'label' etc, using the user-specified lit2mlid hash
convert 'label' to 'lab', etc using the reverse index of the user-specified lit2mlid hash
Like get_langtxt, but first convert with lit2mlid so that 'lab', 'sut' etc can be used
Return the label, normally in the current language and of the current document, but optionally taking dok and lang as arguments.
Return the title, normally in the current language and of the current document, but optionally taking dok and lang as arguments.
Return the subtitle, normally in the current language and of the current document, but optionally taking dok and lang as arguments.
Return the description, normally in the current language and of the current document, but optionally taking dok and lang as arguments.
take document identifier (dok), return url and label
Return sequence of preferred languages for linking, based on what the user indicated, what the current document uses and what the target document $dok allows.
Based on a relation specifier such as
adr:person,postkod:sdeplz,urb:sdeurb,urber:sdeurb2,strad:sdestr,strader:sdestr2,dom:sdedom,domer:sdedom2,adrrem:sdearem
return a tree containing the info needed to construct sql-based put/get queries from vocabulary data.
In the a2e_perl_ebnf (a2e-perl-adapted Extended Backus Naur Form) notation, the input and ouput of this function can be explained as follows:
args :: arguments
args := relspe
relspe :: relation specifier
rets :: return values
rets := rekmap
rekmap :: database_record_info
relsep => [ [ 'adr', 'person' ], [ 'postkod', 'plz' ], [ 'urb' ], [ 'urber', 'urb2' ], [ 'strad', 'str' ], [ 'strader', 'str2' ], [ 'dom' ], [ 'domer', 'dom2' ], [ 'adrrem', 'rem' ] ];
relspe := listref(rekide, fldspe+)
rekide :: record identifier
rekide => [ 'adr', 'person' ]
rekide := listref(tab, idekol+)
fldspe :: field specifier
fldspe => [ 'postkod', 'plz' ]
fldspe := listref(kol, lit?)
kol :: column name
kol => 'postkod'
kol := symbol
lit :: textchunk name
lit => 'plz'
lit := symbol
tab :: table
tab => 'adr'
tab := symbol
ikdekol :: name of identificatory column
idekol => 'person'
idekol := symbol
symbol := string(symchar+)
symchar := char(a-z,A-Z,0-9,_)
rekmap => [ 'adr', [ 'person' ], [ 'urb', 'str', 'dom' ], { dom => 'sdom', person => 'user' } ]
rekmap := listref(tab, idekols, atrkols, column_textchunk_map)
idekols :: identifying columns
atrkols :: attributive columns
atrkols => [ 'urb', 'str', 'dom' ]
atrkols := listref(atrkol+)
atrkol :: attributive column
atrkol => 'urb'
atrkol := symbol
kollits :: column_textchunk_map
kollits => { dom => 'sdom', person => 'user' }
kollits := hashref((kol, lit)+)
args := tmpl, nonlit+
nonlit :: excluded textchunk
return a listref with all the language variables (lits) corresponding to all the database relations that are tied to a given document type (tmpl). Arg2ff is a list of excluded lits.
Obtain full info that can be put into a record of the global database.
In the a2e_perl_ebnf (a2e-perl-adapted Extended Backus Naur Form) notation:
args := relspe, littups
relspe :: relation specifier
relspe => [ [ 'traprop', 'dok', 'lang' ], 'prelang', [ 'tranom', 'lfol' ], [ 'trauid', 'user' ], [ 'tradat', 'hodie' ], [ 'travers', 'ver' ] ]
relspe <= relspe2rekmap
littups :: textchunks to be used as template variables, named as in vocabulary files and dbm hashfiles
littups := hashref((litnom, litval)+)
rets :: return values
rets := putrek, idelits
putrek :: info that can be passed to $m->put so as to put the record into the database
putrek => [ 'traprop', { lang => 'de', dok => 'hrjaN3' }, 'trauid', 'nist', 'tradat', '2010-03-31' ]
idelits => [ 'dok', 'lang' ]
idelits :: identifier variables
idelits := listref(litnom+)
putrek := listref(tab, ideflds, atrflds)
idefls :: identifying_fields
atrflds :: describing_fields
ideflds := hashref((fldnom, fldval)+)
atrflds := hashref((fldnom, fldval)+)
Uses relspe2rekmap to parse this data, as does rellits2getrek
Obtain full info that can be put into a record of the global database.
Input and parsing is like in rellits2putrek.
Output is like in rellits2putrek, but with a smaller first return value column names instead of column tuples and with a second return value.
Here is the synopsis in a2e_perl_ebnf:
args := relspe, littups
rets := getrek, kollits
getrek :: arguments suitable for &A2E::Daba::get_record
littups := hashref((litnom, litval)+)
kollits :: column-textchunk map
getrek := tab, idetups, atrkols
tab :: table
idetup :: identificatory tuple
atrkol :: attributive column
idetup := idekol, ideval
idetups := hashref(idetup+)
atrkols := listref(atrkol+)
idekol :: id column name
ideval :: id column value
getrek => [ 'traprop', { lang => 'de', dok => 'oas_akt1003' }, [ 'prelang', 'tranom', 'trauid', 'tradat', 'travers' ] ]
kollits => { trauid => 'user', prelang => 'prelang', tranom => 'lfol', travers => 'ver', tradat => 'hodie' }
Retrieve the document's metadata from the rdb tables indicated with the special tmplrels directive.
args := dok, data
rets := data
data := hashref((nom, val)+)
data :: initial data tuples on their way to become complete littups
Do not retrieve anything from dbm files -- that is done on a higher level in &A2E::MLHT::dok2tmplvars.
Return a pointer to a hash that contains cached document metadata, conventionally called $data and pointing to $m->{dokreks}->{$dok}->{$lang}, functioning as a handle for reading and writing.
If caching is turned off by means of the --dokdata_cache option, just return an empty hashref.
Similar to dok2urllab, but return a hash of all the language-dependent metadata found in the database
args := dok, lang
rets := littups
retrieve document's url from database.
subroutine of dok2absurl.
Take dok, return absolute url (beginning with 'http://')
Use dir2url if referring to current document, otherwise search database.
return both absolute and relative url for dok, where dok is a document symbol with an optionally appended relative pathname
take dok, return url, as relative as possible, as short as possible (only directory, without full filename 'index*.html', if the rest can be handled by content negotiation)
take dok, return url, as relative as possible, as short as possible (only directory, without full filename 'index*.html', if the rest can be handled by content negotiation)
simpler version of alidok.
possibly no longer needed.
superior document (in the hierarchy) and pretyp (type of subordination relation, 2 for group member, 3 for subdirectory).
exit with error if our dok has no superior node and is also not among the topdoks.
Presupposes set_topdoks.
arg1: dok. if nothing given use $m->{dok} or get it from current directory
superior document (in the hierarchy).
Pathname of superior document node.
Optional first argument: current dok.
Optional second argument: minimal level of subordination, default is 3 = real directory subordination relation, 2 is a document group subordination relation, 1 a precedence relation among equal peers.
like supdir, but also return the corresponding dok (document symbol) and pretyp (subordination type by which its first subdocument is linked to it, usually 2 = group member or 3 = directory).
takes dok, returns name of file where current level\'s hierarchy info should be stored, e.g. '_subdoks' or '_grpdoks', depending on where in the hierarchy we are.
Create closure functions used by rewrite_doksfile
.
Each function is an operation designated by a symbol. Currently we have 'mv' (move) and 'rm' (remove).
The function accepts a list of symbol_word_s that were found before the operation and returns a list of symbol_word_s that remain on that line after the operation (renaming or removing) is completed.
rewrite doksfile $1, applying procedure $2 with following arguments to each line found in the doksfile.
Supported procedures are
mv $id0 $id2
rm $id
That is the following invocations are supported:
$m->rewrite_doksfile('akt/_grpdoks', 'mv', 'a2e_prog0710', 'a2e_adv0710');
$m->rewrite_doksfile('_subdoks', 'rm', 'a2e_prog0710')
The first renames occurrences of a2e_prog0710 to a2e_adv0710, the second removes them.
The files consist of lines which either contain one or more blank separated document identifiers (dok) or comments starting with a hash mark (#). Comment lines are left untouched. Blank lines are removed. When a line contains an identifier that matches the searched one (i.e. arg1 of 'rm' or 'mv'), the identifier is rewritten (i.e. replaced or deleted) and everything else stays unchanged.
FIXED: 2007-12-07: application the 'rm' had been leading to empty files.
? duplicated effort: similar code in get_doks, A2E::Subdoks::doksfile_add ?
Derive local directory from corresponding URL.
Inversion of dir2url, core part of dokdir
Derive local url from remote url.
needed by A2E::Cgidok.
core part of dokdir: return local directory corresponding to a dok.
Take dok url, e.g. something like oas0708/spez/index.de.html, return pathname of corresponding directory on the local host. Suitable as an argument to chdir. An option lang argument should decide whether and for which language we want the dir/url localised. If a global $m->{lang} is set then that has the same effect. Localisation of dir/url names is done by using the alternative directory names stored in traprop.tranom.
take directory, typically the one returned by Cwd::getcwd, and convert this to what the name should ideally be when used in the local file system with shell commands like `cd', e.g.
/homdisk/svn/sig_adv/perl/A2E --> /sig/perl/A2E
The second form is built on symlinks.
This requires configuration, see configurable section above.
This should not happen. It leads to wrong urls generated by dir2url.
SOLUTION: in dokfs.konf: svnbas2dir sig_ffiinnc = /ffiinnc/sig
Wrong URLs generated when directories end in dates. SOLUTION: closure $matchdir, removed old function svnbas2dir
leaf of directory
args := dir
dir => /eupat/stidi/epla
rets := fol
fol => epla
Very trivial provisional means of solving a problem in A2E::Dokdata without loading &File::Spec::Functions::splitdir there, a more robust way would be a function dok2fol that looks up dokprop.doknom
Localising links to the leaf of the current document, e.g. 'papers', 'papiers' and 'papiere' for document 'swpatpapri' with leaf 'papri'.
Derive URL from directory argument or current working directory.
Be fast, ignore @url files and database.
find the document identifier (dok) of the current directory.
Use several methods, each of which are separately defined as a plugin: - search in a file @dok - search in the document names @dok-*.txt and @top-*.??.txt - search in the Makefile.
invoked by configuration statement
get_dok_plugins = meta
invoked by configuration statement
get_dok_plugins = make
invoked by configuration statement
get_dok_plugins = dir
implemented as a wrapper around function dirdok.
get current document using plugged-in methods according to their sequence of priority
invoke get_dok and write the result into $m->{dok}.
find url in url_fayl and write derived info to database.
Return languages of document, based on what is found in the languages file (normally '@langs') of the directory given in arg1 which defaults to the current directory. Analogous to dirdok.
Ideally the languages should be all in the 1st line and separated by whitespace, but this routine is a bit more tolerant. It also accepts comment lines and spread of languages across more lines. Moreover it eliminates doubles.
find languages of the current directory or the directory belonging to the document identifier of argument 1.
store the findings from get_langs in the object
take subdir name and return same if it contains a valid subdocument node, otherwise return nil.
Return the list of subdirectories which may need to be checked/parsed/compiled before the current directory is committed to the subersion repository.
These subdirectories must be in the same subversion repository.
Consequently they can not be symlinks.
Set the object property 'subdirs' to the list returned by subdirs
and return a string representation of that list where the subdirs are separated by whitespaces or, alternatively, by a separator specified in arg 1.
Some programs such as dokfs_subdirs may depend on the returned string, but in the long run this should be in a separate function, not set_subdirs. Normally the subdirs
function should be used, and set_subdirs
should onyl be used as a shorthand for setting the subdirs property.
find the documents of the current document hierarchy level, as typically stored in a _subdoks or _grpdoks file and in corresponding database records.
Return documents of current hierarchy level from a file
Reconstruct documents of current hierarchy level from what is seen in subdirectories and return them
TODO extend to deal with _grpdoks subordination of pretyp 2 as well, use /adv/prg/bin/subdirs.pl:subdirs as a model and possibly as a common basis
store the findings of get_doks
Find all subdoks of the current node and append them to the right _subdoks file as far as they are not already found there or in an inferior _grpdoks file.
Take document identifier (dok), return full path of the editable source file, either multilingual or in specified language or in document's primary language.
This is a basis not only for generating menus but also for determining which templates, css files etc to use in generating the object files.
args := dok, (nom=> val)*
rets := predoks*
list the whole chain of superordinated dokuments from the topdok level down to the given dok, using memory if possible, file system or database otherwise.
Option topinddok defaults to 'topdok' but could also be set to 'inddok'; in the latter case the hierarchy ladder is climbed up to the web domain root directory (where a sitemap_index is to be created) rather than to the microsite (topdok) root (where a sitemap is to be created). Option NFaylP means dont read from filesystem, DabaP means read from database.
Once predoks were obtained properly they are stored in m->{${dok}_${topinddok}_predoks}.
Find upmost node of site, set predoks hierarchy on the way.
Stop unless information about topdoks ($m->{topdoks}) has been collected, e.g. by set_topdoks.
find and store the topdir, i.e. the directory corresponding to the topdok.
This is info needed by the Makefiles that generate object files using templates and CSS files that are stored in this directory.
perform cleanup at topdir level, thus avoiding locking bugs that tend to occur when it is done at a lower level.
Set the filepath of the CSS file as referenced in the HTML object version of the dok.
Return non-null if successful;
Take dok argument, read the whole chain of superordinated documents from the file system
Read document tree from parent directory, return a hash that contains all possibly needed information and is built like $m->{dokprop}
Take dok argument, read the whole chain of superordinated documents from the database.
Take dok argument, read from the database the chain of subordinated documents as far as they belong into a menu.
Used by nav2html(1), makedoksrow(1)
Take a dok, return the flat list of direct subordinates of this dok, as far as it has subordinates (not just postdoks!).
Take a dok, return its entry for the left-hand navigation menu of the HTML version.
Format the menu_subdoks for an HTML menu.
Format an item for a list used in an HTML menu.
Higher level applications can tweak this by setting the $m->{lifmt} variable.
Format the whole subordinate menu of the current document and return it.
take a dok, navdok and subdokmenu, return the dok\'s menu entry.
navdok is the document for which the menu is to be created, subdokmenu is the pre-formatted menu that is only used if we happen to be formatting the entry for navdok itself.
The chain of superordinate documents that belong into the menu, starting from the top, ending at the document given in arg1 or my current dok.
This chain is a bit thinner than the full chain. As we move up the directory hierarchy, only those nodes from which sub-ierarchies are forked out remain important.
We distinguish between level 3 and level 2 sub-hierarchies (subdoks and grpdoks). When moving up the hierarchy, level 2 becomes irrelevant as soon as we have reached a level 3 fork.
At the document itself we are at level 1 (sequenced leaves of same node). We list the preceding leaves, before that the superordinate groups, before that the superordinate directories.
We can set the initial level as an option
typ_min => 1
in arg2ff, which is a hash of options.
Posterior documents of the current hierarchy level, as far as they ought to appear in a menu.
All documents of the menu's current level
Obsolete, needed for backward compatibility with old menu generation mode.
This does most of the work of dokumenu_entries and allows more fine-tuning than dokmenu_entries itself.
The extra choices are needed by some applications such as makedoksrow.
Obsolete, needed for backward compatibility with old menu generation mode.
take a dok, return a full HTML menu for navigation, as typically used on the left side of a webpage.
Obsolete, needed for backward compatibility with old menu generation mode.
set an alias, e.g. from the commandline, and store it in the database.
delete an alias from the database.
Invokable from the commandline with rmtalias(1)
Erase a given document and all related info from the database (DBDEL) and from the doksfile (subdoks, grpdoks). PREPOST: Leave no hole in the document chain, connect the preceding to the following. SUBDOK: Refuse to erase a document that has subdocuments.
Strip document of its topdok status and remove any template files that testified this status.
set present working directory $m->{pwd} with ideal path name or whatever is given to it.
return the dok (document identifier) found in the given dir (directory).
take fol (directory leaf) argument, erase the document found at dir from the file system and the database. %arg2ff are options, including
force: move ahead recklessly
This is normally invoked only via a recursive version rmtdir
which also removes subdirectories.
Recursively remove a document along with its subdocuments. Invocable from commandline as
rmtdir <name>
TODO: These must be connected to the configurable file name templates unifnom, mulfnom, lngfnom etc
@pre.$dok.$lang.txt
or, when $lang is null, @pre.$dok.txt
get first language of current document if there is one
All vocuabulary files belonging to one document, language-neutral before language-specific, template-specific before document-specific.
The first position must be occupied by a prependable file and, if no such file is available, by an empty string.
rank_sufiks is the rank suffix '?+', '' or '?-' that specifies which variable assignments (for unimportant nodes: exported assignements only, for normal nodes: all assigments except unexported ones, for important nodes: all assignements including unexported ones) should be read from the concerned file. For the appended vocabulary files, only those of the current node $m->{dok} are important (of high importance), the other ones are unimportant (of low importance). Template files and prepended (antefnom) files are of normal importance.
It is recognised in A2E::Tmplfil(3) by riid_tmplvars_fayl and used there by tmplini, where more explanations are found.
recursively add superior template directories to head of directory list. also add $m->{tmplang} subdirectories of these, e.g. /opt/a2e/share/tmpl/mlht/a2e/sig_aammdd/multemp subroutine of lng_tmpl_faylz
template files with which LNG_FAYLZ starts
list only files that exist and are readable
list pairs: one language-neutral, one for lang
if not true, list language-dependent files only
Normally, where possible, the source language version is read so as to provide defaults in case no lit is there in the current language.
Set nosrclang true to switch off this behaviour.
lng_faylz(1)
used by Dokdata2db.pm
Create channel: set up the current document as a news channel. Argument 1 is the name of the channel to be created. If this is '1', $m->{dok} is used. If it is '0' or empty, nothing is created. The name of the channel is usually derived from the news_kanal configuration option, but some cases, as in A2E::Mktdir, it is obtained from elsewhere. The other elements of a channel record, which correspond to the news_kanalrem
, news_kanaldat
and news_supkanal
configuration variables, can also be supplied as commandline arguments. The
Insert the current file into one or more news/rss channels. This routine is used by mktdir and dokdata2db.
like dokurls but using predoks info to climb up the tree so as to find a more up-to-date or multilingual URL
Hey! The above document had some coding errors, which are explained below:
=over should be: '=over' or '=over positive_number'
Non-ASCII character seen before =encoding in '碳化物'. Assuming UTF-8
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
Unknown directive: =head
=pod directives shouldn't be over one line long! Ignoring all 4 lines of content
Unknown directive: =head