Download Latest Version VMaX-MarC_r42.zip (105.0 kB)
Email in envelope

Get an email when there's a new version of VMaX-MarC

Home
Name Modified Size InfoDownloads / Week
VMaX-MarC_r42.zip 2022-09-08 105.0 kB
ReadMe.rst 2019-03-17 28.5 kB
VMaX-MarC_r39.zip 2019-03-17 102.6 kB
VMaX-MarC_r38.zip 2019-03-07 102.4 kB
VMaX-MarC_r33.zip 2018-09-02 100.0 kB
VMaX-MarC_r31.zip 2017-11-06 102.4 kB
VMaX-MarC_r30.zip 2017-07-24 96.1 kB
VMaX-MarC_r28.zip 2017-03-07 98.4 kB
VMaX-MarC_r26.zip 2016-12-07 96.1 kB
VMaX-MarC_r24.zip 2016-04-23 94.6 kB
VMaX-MarC_r22.zip 2016-04-04 91.7 kB
VMaX-MarC_r21.zip 2016-03-28 92.1 kB
VMaX-MarC_r20.zip 2016-03-18 92.1 kB
VMaX-MarC_r19.zip 2016-03-14 92.4 kB
VMaX-MarC_r16.zip 2016-03-05 89.7 kB
VMaX-MarC_r12.zip 2016-03-01 89.7 kB
VMaX-MarC_r11.zip 2016-02-27 91.7 kB
VMaX-MarC_r8.zip 2015-03-29 120.2 kB
Totals: 18 Items   1.7 MB 0

VMaX-MarC

Brief history of project

Originally developed only for my needs - and for generation of only HTML, as part of project that allowed generation of also CSS and JavaScript. Later I allowed also other sets of elements. And in February of 2015, after separation from original project, I published it for public using, if someone would like to use it. And development goes on.

Development

You may write your ideas for further development through tickets, here, on SourceForge.net. Mostly awaited are ideas for

  • functionalities
  • changes of classes and methods

About used naming convention

Constants
UPPERCASE_WITH_UNDERSCORES
NULL, TRUE, FALSE constants
UPPERCASE
Methods, classes
PascalCase
Variables, properties
PascalCase
Array keys, named matches
lowercase_with_underscores
  • Class may contain method named Execute.
  • Protected and private methods (excepting magic methods) have to contain one of following prefixes in name.
  • Public methods (excepting magic methods) should have to contain one of following prefixes in name.
  • Classes with methods only for saving and reading of data may not need to have methods with prefix in name.
add extend code with something, add something to code
assemble assemble from more parts, concat more parts into one
convert change form
disable switch something off, set property to FALSE
enable switch something on, set property to TRUE
get load/prepare from source
has is owner of
is corresponds to, is equal to, has attribute
set set from external scope
load load from properties
count count anything

Prefix add differs from prefix set in place of usage of current element. Set element is used in a independent way on place of its usage.

About used formatting convention

  • indentations are done by tabs (NOT SPACES)
  • tabs have length of 5 spaces

About used coding convention

  • condition switch cannot contain another such condition unless it is inside of else condition
  • ternar operator should not be inserted into else ternar operator

Concrete and final classes

CheckOptions

Extension for VMaX-UniCAT's CheckOptions. Adds following non-type options.

Is_ContentUsage content usage controllers
Is_ValuesSeparator allowed separators for attributes multiple values
Is_ElementsContent allowed content for elements
Is_CodeHeading allowed code heading (mostly DTD) lines
Is_ConditionalComment allowed conditional comment for IE
Is_ElementsListExtension elements list extension controllers

CheckTypes

Extension for VMaX-UniCAT's CheckTypes. Adds following type options.

Is_StringArray checks for string or array

LoadOptions

Extension for VMaX-UniCAT's LoadOptions. Adds following non-type options.

ContentUsage content usage controllers
ValuesSeparator allowed separators for attributes multiple values
ElementsContent allowed content for elements (DTD standard switchers)
CodeHeading allowed code heading (mostly DTD) lines
ConditionalComment allowed conditional comment for IE
ElementsListExtension elements list extension controllers

LoadTypes

Extension for VMaX-UniCAT's LoadTypes. Adds following type options.

StringArray checks for string or array

DTDReader

Reads DTD file(s) and prepares list of usable elements.

__construct encapsulates Set_File
Set_File sets used file
Add_Element manually adds element to list of usable elements

DTDLine

Adds DTD line to code. Extends class DTDReader and in that way allows to add DTD line into code and set element list in one step.

__construct encapsulates Set_Line
Set_Line sets used DTD line
Execute executes adding of DTD line into code

CodeGenerator

Generates base of markup code - one element. Element may come from various sets defined by used DTD.

__construct sets name of created element
Enable_InLineElement forces creation of element as in-line element
Set_Style sets style
Set_Attribute sets attributes - excepting style
Set_ValuesSeparator sets separator for multi-value attributes - excepting style
Set_Content sets content
Execute executes code generation

SimpleAssembler

Generates row of one element that may be wrapped to the same or different element.

__construct sets used elements
Disable_TopLevel disables wrapping of elements row into other element
Set_TopLevelStyles sets styles for top level element
Set_TopLevelAttributes sets attributes for top level element
Set_SubLevelStyles sets styles for sub level element
Set_SubLevelAttributes sets attributes for sub level element
Set_TopLevelValuesSeparator sets separator for top level multi-values attributes
Set_SubLevelValuesSeparator sets separator for sub level multi-values attributes
Execute executes code generation

This class has following extensions:

  • LinksAssembler_All
  • LinksAssembler_IE
  • ScriptsAssembler_All
  • ScriptsAssembler_IE
  • ListAssembler_Ol
  • ListAssembler_Ul
  • RowAssembler_Div
  • RowAssembler_Tr

DualAssembler

Uses SimpleAssembler in a multiple way - and wraps generated structures to other element. May be used to create for example simple tables or select menu with optgroup (or without optgroup).

__construct sets used elements
Disable_TopLevel disables wrapping of elements row into other element
Enable_SimpleOrder enables usage of elements in order set in constructor in all code
Set_UniqueHighlight sets attribute used only for element with special value
Set_TopLevelStyles sets styles for top level element
Set_TopLevelAttributes sets attributes for top level element
Set_MiddleLevelStyles sets styles for middle level element
Set_MiddleLevelAttributes sets attributes for middle level element
Set_SubLevelStyles sets styles for sub level element
Set_SubLevelAttributes sets attributes for sub level element
Set_TopLevelValuesSeparator sets separator for top level multi-values attributes
Set_MiddleLevelValuesSeparator sets separator for middle level multi-values attributes
Set_SubLevelValuesSeparator sets separator for sub level multi-values attributes
Set_MiddleLevelContentAttribute sets attribute used for special content
Execute executes code generation

This class has following extensions:

  • MenuAssembler_SelectOptgroupOption
  • TableAssembler_TableTrTd

UniqueAssembler

Generates row of various elements that may be wrapped to other element. All elements have to be unique.

__construct sets used elements
__call allows to set styles, attributes and multi-value separators to each element
Disable_TopLevel disables wrapping of elements row into other element
Set_ElementsNamespace duplicates namespace used with element in constructor
Set_TopLevelAttributes sets attributes for top level element
Set_SubLevelStyles sets styles for sub level element
Set_SubLevelAttributes sets attributes for sub level element
Set_TopLevelValuesSeparator sets separator for top level multi-values attributes
Set_SubLevelValuesSeparator sets separator for sub level multi-values attributes
Execute executes code generation

This class has following extensions:

  • HeadAssembler_MetaTitle
  • RootAssembler_Html

UnknownAssembler

Allows to wrap random previously generated code to other element. Alternative class trace allows to easily concat code generated by this class with code generated by other classes.

__construct sets used elements
Disable_TopLevel disables wrapping of elements row into other element
Set_ClassTrace provides alternative class trace
Set_TopLevelAttributes sets attributes for top level element
Set_SubLevelStyles sets styles for sub level element
Set_TopLevelValuesSeparator sets separator for top level multi-values attributes
Execute executes code generation

Traits with public access methods

Methods are described in classes where are used.

IndentionDisabling

Allows to set elements that will be not indented. Method is abstract - because each class needs it defined in a different way.

Usages in classes of VMaX projects:

MarC CodeGenerator
SimpleAssembler
DualAssembler
UniqueAssembler
UnknownAssembler

ContentSetting

Allows to set content. Method is abstract - because each class needs it defined in a different way.

Usages in classes of VMaX projects:

MarC CodeGenerator
SimpleAssembler
DualAssembler
UniqueAssembler
UnknownAssembler

Exceptions

Exception

Extension for VMaX-UniCAT's Exception

Source: ReadMe.rst, updated 2019-03-17