.obj : object definitions used in the template or in source files

two example : the main .obj and one from a subdirectory

ManyPage objects are used in .dress file to be eventually replaced by HTML code. They are objects in the meaning of Object Oriented Programming : an object can be defined using one or more objects and object value can be modify for some subdirectories or even for some specific file.

An object can be used (that means that it will be replaced by its value) in a .dress file, in another object definition in a .obj file, or even in an HTML source file. That allows the webmaster to propose, to the editorial team, a collection of graphical objects that will always match the design of the web site (For instance division bar or icon to illustrate phone number). That could be done through the use of a dedicated palette in DreamWeaver for instance.

An object is a XLM like tag which name begin with MP or PM depending on its category.

Objects defined in .obj files : <MP.YYY>

The webmaster will define as many object as he likes in .obj files by putting HTML code and other objects between an opening and a closing tag.

Syntax

<MP.object.name>
   object value
</MP.object.name>

Example

<MP.RED.POINT>
   <IMG SRC="/icon/red.gif">
</MP.RED.POINT>

It is often interesting to separate a part which could be used in different objects and/or, could change in some subdirectories. You may want to divide the definition of your objects by using one or more objects within the definition of another one, which become a complex object :

Example

<MP.ICON.PATH>
   /icon/
</MP.ICON.PATH>
allows then to define

<MP.RED.POINT>
   <IMG SRC="<MP.ICON.PATH>red.gif">
</MP.RED.POINT>


Which define exactly the same object as the first definition.
Note that the leading and ending spaces in an object value are deleted at replacement time.

If you write the following file in the Source directory

<HTML>
<HEAD>
<TITLE>example 1</TITLE>
</HEAD>

<BODY>
<MP.RED.POINT>a<BR>
<MP.RED.POINT>b<BR>
</BODY>
</HTML>


You will get with both definition the following file in the Destination directory

<HTML>
<HEAD>
<TITLE>example 1</TITLE>
</HEAD>

<BODY>
<IMG SRC="/icon/red.gif">a<BR>
<IMG SRC="/icon/red.gif">b<BR>
</BODY>
</HTML>

Despite of this example, remember that objects are mainly used in .dress files.

Heritage

This is one of the main feature of ManyPage. It explains why it is interesting to divide your big objects in many little ones. You may define a general object at the root of the web site, and change only some or all of its parts in some subdirectories or even only for one file. This is why there is usually a big '.obj' file at the root, and some little one in the subdirectories. Remember that a '.obj' file applies to the directory to which it belongs and to all its descendant directories. You define a .obj for only one file by naming it with the file prefix and the "obj" suffix (example : index.obj).

Imagine that you have the following definition in the root .obj :

<MP.ICON.PATH>
   /icon/
</MP.ICON.PATH>

<MP.POINT.FILE>
   red.gif
</MP.POINT.FILE>
<MP.POINT>
   <IMG SRC="<MP.ICON.PATH><MP.POINT.FILE>">
</MP.POINT>

and only the following .obj file in the "Sky" directory

<MP.POINT.FILE>
	blue.gif 
</MP.POINT.FILE>

Then all the POINT will be red, except in the "Sky" directory where they will be blue. And you only have to modify (or "extend") a little object to get that change, not all of them.

You may also decide that you don't want to use an image for your POINT object, and that, only for the dull.en.html and dull.fr.html files. Then you only have to create a dull.obj file in which you replace only the POINT object definition at once :

<MP.POINT>
   (o)
</MP.POINT>


Notice that at that point, you may still use any of the objects that have been defined at the root level and which have not been replaced

Objects defined by ManyPage : <PM.XXX>

The following objects are produced by ManyPage, from the examination of the source file and sometime of some dependent files associated by .link files . They will be replaced by their "Replacement value".

 

 

ManyPage Tag Replacement value Example for this very page

3 main objects

<PM.HEAD> What is between HEAD tags in the source file not significant
<PM.BODY.ATTRIBUT> All the attributes of the tag BODY of the source file not significant
<PM.BODY> What is between BODY tags in the source file not significant
 

Other objects

<PM.KEYWD.FILENAME> Name of the source file, without its suffix (.fr.html ...). obj
<PM.KEYWD.BACK> Link (URL) to the Previous Page. This object is properly replaced only in a URL context (inside an HREF attribute for instance). dress.+
<PM.KEYWD.UP> Link (URL) to the Parent (table of contents...) Page. This object is properly replaced only in a URL context (inside an HREF attribute for instance). template.+
<PM.KEYWD.NEXT> Link (URL) to the Next Page. This object is properly replaced only in a URL context (inside an HREF attribute for instance). link.+
<PM.KEYWD.TITLEBACK> Title (Between the tag TITLE within the HEAD) of the Previous Page. .dress : the main template : the target web page structure
<PM.KEYWD.TITLEUP> Title of the Parent Page. 2 central configuration files and 3 types of file to describe the dressing
<PM.KEYWD.TITLENEXT> Title of the Next Page. .link : the browsing tree
<PM.KEYWD.LANG> Language suffix of the produced page (fr, en ...). en
<PM.KEYWD.DATE.MODIF> File Modification Date (D/M/YYYY). To be used inside the text to prove that the content (the source file !) is up to date 25/3/2002
<PM.KEYWD.DATE.HAB> Production (ManyPage run) Date (normalized format). To be used in Meta Tag "date". For instance : <META Name="date" Content="Thu, 08 Feb 2001 17:11:05 GMT"> Sat, 22 May 2021 17:07:36 GMT
<PM.KEYWD.DATE> same value as PM.KEYWD.DATE.HAB, but in a short format : (DD/MM/YYYY) 22/05/2021
     

Future objects (not available in the 0.9 version)

not yet significant
<PM.TITLE> not yet available (forgetting) PM.TITLE
<PM.KEYWD.TITLE> not yet available (idem PM.TITLE) PM.KEYWD.TITLE

See explanation about .link file or the presentation of the browsing model for more details about BACK, UP and NEXT like objects.

Objects defined in the .obj file with a special behaviour

Multilingual web site

The language suffix are defined within <PM.LANGAGE>

<PM.LANGAGE> is a sort of abstract object that you have to implement in order to define the languages you want to use in your multilingual web site. For instance, the following code inside your .obj file will define two language suffixes.

<PM.LANGAGE>
   <PM.LANG TYPE=fr>Fran&ccedil;ais</PM.LANG>
   <PM.LANG TYPE=en>English</PM.LANG> 
</PM.LANGAGE>


Note that the definition order match the source files research.

This definition will have 4 different effects.

Page suffix

First it defines the number of page that are produced and the ones that ManyPage should look for to deal with . For instance from an existing index.fr.html, it will look for a matching index.en.html. If it finds it, it will produce the two corresponding files in the Destination directory. If it doesn't find an index.en.html, then it copies the existing index.fr.html to the produced index.en.html and change all the links in order to let them remains within the "English" hierarchy.

Generic suffix transformation

When you use a ".+" suffix (instead of .fr.html for instance) at an URL end or within the ".link" files, ManyPage will replace it with the good suffix in each produced page. A link "/Link/file.+" into file index.en.html, will be modified into "/Link/file.en.html" for instance. Be careful, ManyPage considers that links exist only as a value of one of the following HTML attributes : 'HREF', 'SRC', 'BACKGROUND' and 'CODE'.

Multilingual ManyPage objects

You may want to define different objects depending on the page's language. There are two ways to do that.

First you may define as many objects as stated in the 'LANGAGE' tag. They should get the same name but with a suffix based on the matching language. Then you put all these objects within another one. At run time, only the object with the matching suffix will remain in the matching file (the one with the same suffix). For instance only "Hello World" will appear in the file obj.en.html, even if I put the tag <MP.HELLOWORLD> in the source file : Hello World

<MP.HELLOWORLD.FR>
	Salut la plan&egrave;te !
</MP.HELLOWOLRD.FR>


<MP.HELLOWORLD.EN>
	Hello World
</MP.HELLOWOLRD.EN>

<MP.HELLOWORLD>
	<MP.HELLOWORLD.FR><MP.HELLOWORLD.EN>
</MP.HELLOWOLRD>


The other way to get the same result is to define only one tag but by inserting language delimiter for each part. These delimiters are of the following format : <PM.languageSuffix> and </PM.languageSuffix>.
Because of backward compatibility MP.languageSuffix tag are reserved tag, could -but should not- be used instead of PM.languageSuffix tag, and should not be redefined by the webmaster for another use.

The former example could be get with the following definition indeed :

<MP.HELLOWORLD>
	<PM.FR>Salut la plan&egrave;te !</PM.FR>
	<PM.EN>Hello World</PM.EN>
</MP.HELLOWOLRD>


WARNING.LANG object

WARNING.LANG object is another object that should be defined by the webmaster, but that will have a special behaviour : the <MP.WARNING.LANG.FR> will appear in the Destination toto.fr.html file only if the source toto.fr.html file doesn't exist (but that the toto.en.html one does). It is useful when you work on a multilingual website, and when you develop some part of the site without translating them at once.

Here is an instance of use of the WARNING.LANG tag. This object is defined in the root .obj file and is used in the .dress file of all this web site, but it appears only in certain parts, when I haven't yet finished the work...

<MP.WARNING.LANG.FR>
	<CENTER>
		<B>Cette Page n'est pas traduite, d&eacute;sol&eacute;.</B>
	</CENTER> 
</MP.WARNING.LANG.FR>

<MP.WARNING.LANG.EN>
	<CENTER>
		<B>This page is not translated, sorry.</B>
	</CENTER> 
</MP.WARNING.LANG.EN>

<MP.WARNING.LANG>
	<MP.WARNING.LANG.FR><MP.WARNING.LANG.EN>
</MP.WARNING.LANG>

 

The minimal programming Structure : PM.IF

You may want to define some generic objects that may be different depending on depending on the context in which they are used (for instance depending on the existence or not of a 'following' page).

Here is the main structure. If 'A' is a non empty defined tag, then the value of the object will be C, else it will be D or nothing if the ELSE attribute is not defined (it is optional).

<PM.IF EXIST=`A` THEN=`C` ELSE=`D`>

You may use this structure with one of the following tags, which exist only in certain situations : <MP.WARNING.LANG.anyLanguageSuffix>, <PM.KEYWD.BACK>, <PM.KEYWD.UP>, <PM.KEYWD.NEXT>

Other structures

Structure Test True example
<PM.IF EXIST=`A` THEN=`C` ELSE=`D`> A existence <PM.KEYWD.UP> when a parent has been defined in the .link file
<PM.IF NOEXIST=`A` THEN=`C` ELSE=`D`> A non existence <MP.WARNING.LANG.FR> when the "fr" file does not exist
<PM.IF TEST=`A PM.EQ B` THEN=`C` ELSE=`D`> A and B equality

A contain the same HTML text than B
A=fool and B=fool

<PM.IF TEST=`A PM.NE B` THEN=`C` ELSE=`D`> A and B non equality A=toto and B=tata
<PM.IF TEST=`A PM.LT B` THEN=`C` ELSE=`D`> A less than B A=alphabet and B=wysiwyg
<PM.IF TEST=`A PM.GT B` THEN=`C` ELSE=`D`> A greater than B A=wysiwyg and B=Alphabet
<PM.IF TEST=`A PM.CT B` THEN=`C` ELSE=`D`> A contain B A=anticonstitutionellement and B = constitution
<PM.IF TEST=`A PM.NC B` THEN=`C` ELSE=`D`> A not contain B A=bonjour B=hello

 

ManyPage object with parameter

To modify some parts of complexes objects, you need to have access to .obj files. If you want to provide simple customizable objects to you editorial team, without allowing them to modify the .obj files, or if you want to derive different similar objects from one modele in the same .obj file, you may want to use object parameters.

You may use the tag <MP.OBJECTNAME attribut1="value1" attribut2="value2"> inside any html source file if you have defined an object that use somewhere in its definition PM.ATTRIBUT.attribut1 and PM.ATTRIBUT.attribut2

For instance, with the following .obj file :

<MP.ENCADRE>
	<MP.RED.POINT>
	PM.ATTRIBUT.TEXT
	<MP.RED.POINT>
</MP.ENCADRE>

if you use the tag ENCADRE in the following way in a source file :

<MP.ENCADRE TEXT="Hello World">

Then you'll get the following HTML in the Destination file :

<IMG SRC="/icon/red.gif">Hello World<IMG SRC="/icon/red.gif">

You may want to define default values for your parameters. They will appear in the opening tag definition :

<MP.HR WIDTH="500" HEIGHT="3">
	<CENTER><IMG SRC="/Icon/Serveur/MP/hr.jpg" WIDTH=PM.ATTRIBUT.WIDTH 
				HEIGHT=PM.ATTRIBUT.HEIGHT></CENTER>
</MP.HR>


So if you use <MP.HR WIDTH="100">

You'll get : <CENTER><IMG SRC="/Icon/Serveur/MP/hr.jpg" WIDTH=100 HEIGHT=3></CENTER>

Comments

You should put as many comments as possible to describe your objects defined in .obj files. They will all disappear in the production process. A comment in a .obj file is the same as in HTML format. :

<!-- This is a comment, which will disappear -->

If you really want to keep your comment in the produced HTML file, you should put it in the .dress file or put a little draw (-) at the beginning of your .obj comment.

<!-- - This is a comment that won't disappear -->

Debugage

When you use all the ManyPage possibilities, you may get quite large .obj files and sometime with bugs difficult to find (badly closed, or with different opening and closing names). These bugs may sometime slow down ManyPage running without stoping it. In order to help yourself to find bug, you can use the check_obj.pl script which you will find in the ManyPage package.

You only have to run it, with your .obj file as an argument. You'll get the list of the defined objects and whenever necessary, error messages.

Copyright 1994-2009
Pascal Vuylsteker

Last modified:
25/3/2002

Send your comments at :
<pvk@vuylsteker.net>