From 0a9887617b2eed6666fe2412d1be0df1c1376299 Mon Sep 17 00:00:00 2001 From: jensp Date: Fri, 12 Sep 2014 18:11:51 +0000 Subject: [PATCH] Foundry current status git-svn-id: https://svn.libreccm.org/ccm/trunk@2853 8810af33-2d31-482b-a856-94f89814c4df --- .../foundry/doc/foundry-documentation.html | 351 ++++++++++++++ .../foundry/doc/foundry-documentation.xml | 20 + .../doc/static-texts/devel/coding-style.html | 60 +++ .../devel/foundry-doc-system.html | 13 + .../static-texts/devel/foundry-structure.html | 13 + .../foundry/doc/static-texts/overview.html | 13 + .../doc/static-texts/user/about-foundry.html | 13 + .../doc/static-texts/user/css-files.html | 13 + .../static-texts/user/layout-templates.html | 13 + .../foundry/doc/xsl/foundry-documentation.xsl | 197 ++++++++ .../web/themes/foundry/foundry/lib.xsl | 30 ++ .../foundry/foundry/lib/global-vars.xsl | 220 +++++++++ .../foundry/foundry/lib/template-parser.xsl | 126 +++++ .../foundry/foundry/lib/template-tags.xsl | 28 ++ .../foundry/lib/template-tags/data-tags.xsl | 76 +++ .../foundry/lib/template-tags/html-tags.xsl | 448 ++++++++++++++++++ .../foundry/lib/template-tags/loaders.xsl | 60 +++ .../web/themes/foundry/foundry/lib/utils.xsl | 78 ++- .../foundry/templates/default-layout.xml | 10 + 19 files changed, 1780 insertions(+), 2 deletions(-) create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.html create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.xml create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/coding-style.html create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/foundry-doc-system.html create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/foundry-structure.html create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview.html create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/about-foundry.html create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/css-files.html create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/layout-templates.html create mode 100644 ccm-sci-bundle/web/themes/foundry/doc/xsl/foundry-documentation.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/lib.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/lib/global-vars.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/data-tags.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/loaders.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/templates/default-layout.xml diff --git a/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.html b/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.html new file mode 100644 index 000000000..e876d5ca5 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.html @@ -0,0 +1,351 @@ + + + + +Foundry Theming Engine for LibreCCM - Documentation + + + +
+ Header +
+ +
+
+

Overview

+

+ Placeholder +

+
+
+

User Manual

+
+

About Foundry

+

+ Placeholder +

+
+
+

Layout templates

+

+ Placeholder +

+
+
+

CSS files

+

+ Placeholder +

+
+
+

Templates Tags Reference

+

aside

+
+
+ Description +
+
+ Generates a HTML5 aside element. +
+
See also
+
+ +
+
+

body

+
+
+ Description +
+
+ Generates the HTML body element. +
+
See also
+
+
    +
    +
    +

    div

    +
    +
    + Description +
    +
    + Generates a HTML div element. +
    +
    See also
    +
    +
      +
      +
      +

      divIfNotEmpty

      +
      +
      + Description +
      +
      + Generates a HTML div element, but only if the content is not empty. +
      +
      See also
      +
      +
        +
        +
        +

        footer

        +
        +
        + Description +
        +
        + Creates a HTML5 footer element. +
        +
        See also
        +
        +
          +
          +
          +

          head

          +
          +
          + Description +
          +
          + Creates the HTML head element which may contain meta data and stylesheets + etc. It also generates some meta data like the generator meta information or the + language meta information. +
          +
          See also
          +
          +
            +
            +
            +

            header

            +
            +
            + Description +
            +
            + Generates a HTML5 header element. +
            +
            See also
            +
            +
              +
              +
              +

              main

              +
              +
              + Description +
              +
              + Generates a HTML5 main element. +
              +
              See also
              +
              +
                +
                +
                +

                meta

                +
                +
                + Description +
                +
                + Generates a meta data field in in the head element. +
                +
                See also
                +
                +
                  +
                  +
                  +

                  nav

                  +
                  +
                  + Description +
                  +
                  + Generates a HTML5 nav element. +
                  +
                  See also
                  +
                  +
                    +
                    +
                    +

                    script

                    +
                    +
                    + Attributes +
                    +
                    +
                    +
                    +absolute +
                    +
                    + If set to true the path in the src is used as it is. +
                    +
                    +src +
                    +
                    + The path of the script to include. If the absolute> attribute is not + set (or not set to true the path is interpreted relative to the + theme directory. For example the path of a script included using +
                    +                <script type="text/javascript" src="scripts/example.js"/>
                    +                
                    + in the a theme named my-theme at the server + http://www.example.org is altered to the absolute path + http://www.example.org/themes/published-themedir/itb/scripts/example.js. + If the absolute attribute is set to true the path is not + altered. One usecase for an absolute path is to load an script from a content delivery + network. +
                    +
                    +type +
                    +
                    + The type of the script. Usally this is text/javascript. If the attribute + is not set in the layout template, it is automatically set to + text/javascript. +
                    +
                    +
                    +
                    + Description +
                    +
                    + Used to include a script (usally a JavaScript). The script is either provided + a content of the element or as an external file. Embedded scripts should only be used + for small parts of code, like the code for activating jQuery plugins for some elements. + Everything which is longer than five or six lines should be put into a external file + in the scripts directory of the theme. +
                    +
                    See also
                    +
                    +
                      +
                      +
                      +

                      section

                      +
                      +
                      + Description +
                      +
                      + Generates a HTML5 section element. +
                      +
                      See also
                      +
                      +
                        +
                        +
                        +

                        span

                        +
                        +
                        + Description +
                        +
                        + Generates a span element. +
                        +
                        See also
                        +
                        +
                          +
                          +
                          +

                          title

                          +
                          +
                          + Description +
                          +
                          + Generates the title in the HTML head. +
                          +
                          See also
                          +
                          +
                            +
                            +
                            +
                            +
                            +
                            +

                            Developer Manual

                            +
                            +

                            The overall structure of foundry

                            +

                            + Placeholder +

                            +
                            +
                            +

                            Foundry Coding Style

                            +

                            + This document describes the coding conventions for the Foundry theming engine. +

                            +

                            Naming

                            +

                            + The naming rules described here apply to all names: Names of layout elements, + XSL template names, EXSLT functions, files, ids and classes (in the + class attribute). +

                            +

                            + Use the dash "-" to separate parts of a name instead of camel case or the + underscore. For example: get-setting instead of getSetting or + set_setting. +

                            +

                            + Names should be lowercase. +

                            +

                            Namespace declarations

                            +

                            + In the XSL files, XML namespaces are only defined at the + <xsl:stylesheet> element. The XSL namespace is the first one is + declared first. The other namespace follow in alphabetic order (ordered by their + prefix). +

                            +

                            Indention, line length and formating

                            +

                            + Indention is done using spaces. Indention depth is four (4) spaces per level. +

                            +

                            + Try to keep the line length below 100 characters per line. Because of some restrictions + of XML this will be possible in every case. +

                            +

                            + Insert a line break after each attribute of an XML element. The first attribute + is on the same line as the element. For example write +

                            +
                            +<xsl:param name=example-param"
                            +           select="'example'"/>
                            +        
                            +

                            + instead of +

                            +
                            +<xsl:param name=example-param" select="'example'"/>
                            +        
                            +
                            +
                            +

                            The documentation system of Foundry

                            +

                            + Placeholder +

                            +
                            +
                            +
                            + + + diff --git a/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.xml b/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.xml new file mode 100644 index 000000000..ec0cd132b --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/coding-style.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/coding-style.html new file mode 100644 index 000000000..fa5982518 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/coding-style.html @@ -0,0 +1,60 @@ + + + + Foundry Coding Style + + + +

                            Foundry Coding Style

                            +

                            + This document describes the coding conventions for the Foundry theming engine. +

                            +

                            Naming

                            +

                            + The naming rules described here apply to all names: Names of layout elements, + XSL template names, EXSLT functions, files, ids and classes (in the + class attribute). +

                            +

                            + Use the dash "-" to separate parts of a name instead of camel case or the + underscore. For example: get-setting instead of getSetting or + set_setting. +

                            +

                            + Names should be lowercase. +

                            + +

                            Namespace declarations

                            +

                            + In the XSL files, XML namespaces are only defined at the + <xsl:stylesheet> element. The XSL namespace is the first one is + declared first. The other namespace follow in alphabetic order (ordered by their + prefix). +

                            + + + +

                            Indention, line length and formating

                            +

                            + Indention is done using spaces. Indention depth is four (4) spaces per level. +

                            +

                            + Try to keep the line length below 100 characters per line. Because of some restrictions + of XML this will be possible in every case. +

                            +

                            + Insert a line break after each attribute of an XML element. The first attribute + is on the same line as the element. For example write +

                            +
                            +<xsl:param name=example-param"
                            +           select="'example'"/>
                            +        
                            +

                            + instead of +

                            +
                            +<xsl:param name=example-param" select="'example'"/>
                            +        
                            + + diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/foundry-doc-system.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/foundry-doc-system.html new file mode 100644 index 000000000..cc784f2da --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/foundry-doc-system.html @@ -0,0 +1,13 @@ + + + + The documentation system of Foundry + + + +

                            The documentation system of Foundry

                            +

                            + Placeholder +

                            + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/foundry-structure.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/foundry-structure.html new file mode 100644 index 000000000..00f32aa54 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/devel/foundry-structure.html @@ -0,0 +1,13 @@ + + + + The overall structure of foundry + + + +

                            The overall structure of foundry

                            +

                            + Placeholder +

                            + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview.html new file mode 100644 index 000000000..ece024a94 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview.html @@ -0,0 +1,13 @@ + + + + Foundry Documentation - Overview + + + +

                            Overview

                            +

                            + Placeholder +

                            + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/about-foundry.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/about-foundry.html new file mode 100644 index 000000000..86f553bf5 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/about-foundry.html @@ -0,0 +1,13 @@ + + + + About Foundry + + + +

                            About Foundry

                            +

                            + Placeholder +

                            + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/css-files.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/css-files.html new file mode 100644 index 000000000..29e013362 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/css-files.html @@ -0,0 +1,13 @@ + + + + Foundry Documentation - CSS files + + + +

                            CSS files

                            +

                            + Placeholder +

                            + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/layout-templates.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/layout-templates.html new file mode 100644 index 000000000..a5fe8e88c --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/layout-templates.html @@ -0,0 +1,13 @@ + + + + Foundry Documentation - Layout templates + + + +

                            Layout templates

                            +

                            + Placeholder +

                            + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/xsl/foundry-documentation.xsl b/ccm-sci-bundle/web/themes/foundry/doc/xsl/foundry-documentation.xsl new file mode 100644 index 000000000..02229c7a0 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/xsl/foundry-documentation.xsl @@ -0,0 +1,197 @@ + + + ]> + + + + + + + + + + + + + Foundry Theming Engine for LibreCCM - Documentation + + + +
                            + Header +
                            + +
                            + +
                            +
                            + Footer +
                            + + +
                            + + +
                            +

                            + +

                            + +
                            +
                            + + +
                            + + + + + + +
                            + + + + +
                            + +
                            +
                            +
                            +
                            + + +
                            +

                            + +

                            + + + +
                            +
                            + + + + + + +

                            + +

                            +
                            + +
                            +
                            + + +
                            + Attributes +
                            +
                            +
                            + +
                            +
                            +
                            + + +
                            + + + +
                            +
                            + +
                            +
                            + + +
                            + Description +
                            +
                            + + +
                            +
                            + + + + + + + + +

                            + + +

                            +
                            + + +
                            +            
                            +        
                            +
                            + + +
                            See also
                            +
                            +
                              + +
                            +
                            + +
                            + + +
                          • + + + + + + + + + + +
                          • +
                            + +
                            \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib.xsl new file mode 100644 index 000000000..904a52cb5 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib.xsl @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/global-vars.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/global-vars.xsl new file mode 100644 index 000000000..2ac40f07c --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/global-vars.xsl @@ -0,0 +1,220 @@ + + + + + ]> + + + + + + + + + The version of Foundry. + + + + + + + + + + The path the to theme file. This path is used at several points to load files which are + part of the theme, like CSS files, images and fonts. + + + + + + + The context prefix in which CCM is installed. If CCM is installed into the ROOT context + of the servlet container, this variable will be empty. + + + + + + + The path on which the CCM dispatcher Servlet is mounted. Usually this is CCM + + + + + + + + + + + + + + + + + This variables stores the XML created by CCM for later access. + + + + + + + + + + Activate double click protection on buttons? + + + + + + + Activate double click protection on links? + + + + + + + + + + + The language to use as negotiated by CCM. + + + + + + + + + The languages supported by this theme. They are configured in + settings/global.xml using the <supported-languages> + element. Example for german and english: +
                            +                <?xml version="1.0"?>
                            +                <settings>
                            +                    …
                            +                    <supported-languages default="de">
                            +                        <language locale=de">
                            +                        <language locale=en">
                            +                    </supported-languages>
                            +                    …
                            +                </settings>
                            +            
                            +
                            +
                            + + + + + The language to use by theming engine for static texts etc. The language is determined + as follows: +
                              +
                            • If the negotiated language is also in the supported-languages
                            • +
                            • If not the language which set by the default attribute of the + <supported-languages> is used, but only if this language + is in the supported languages.
                            • +
                            • Otherwise the first of the supported languages is used.
                            • +
                            +
                            +
                            + + + + + + + + + + + + + + + + + + + + + The name of the user agent (browser) which is used to access CCM. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl new file mode 100644 index 000000000..060f5c3e9 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl @@ -0,0 +1,126 @@ + + + ]> + + + + + + + The name of the template file to process. + + + This template is the entry point for the template parser. + + + + + + + + + + + Root element of a template. Generates the doctype statement and and + <html> root element. + + + + <!DOCTYPE html> + + + + + + + + cms + + + site + + + + + + + + + + Root element for generating a HTML fragment instead of a complete HTML document. + + + +
                            + +
                            +
                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags.xsl new file mode 100644 index 000000000..080bee716 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags.xsl @@ -0,0 +1,28 @@ + + + + + + + + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/data-tags.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/data-tags.xsl new file mode 100644 index 000000000..f80979b60 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/data-tags.xsl @@ -0,0 +1,76 @@ + + + + + + + + + + + +

                            + +

                            +
                            +
                            +
                            + + + + Outputs a static text which is retrieved from the + static-texts/global.xml file in the layout file. The key is the content + of the element. If at least one of the attributes id, class + or with-colorset is present at the attribute, the text is wrapped in a + span element. + + + + An unique id for the text. + + + One or more classes to format the text per CSS. + + + Add the classes for using the Colorset feature to the span element + the text is wrapped in. + + + + + + + + + + + + + + + + + +
                            \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl new file mode 100644 index 000000000..125062ab0 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl @@ -0,0 +1,448 @@ + + + ]> + + + + + + Generates a HTML a element. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Generates a HTML5 aside element. + + + + + + + + + + + + Generates the HTML body element. + + + + + + + + + + + + + + + + + + + + Generates a HTML div element. + + + + + + +
                            + + +
                            +
                            + + + + Generates a HTML div element, but only if the content is not empty. + + + + + + + + + + + +
                            + + +
                            +
                            +
                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates a HTML5 footer element. + + + + + + +
                            + + +
                            +
                            + + + + Creates the HTML head element which may contain meta data and stylesheets + etc. It also generates some meta data like the generator meta information or the + language meta information. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Generates a HTML5 header element. + + + + + + +
                            + + +
                            +
                            + + + + Generates a HTML5 main element. + + + + + + +
                            + + +
                            +
                            + + + + + Generates a meta data field in in the head element. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Generates a HTML5 nav element. + + + + + + + + + + +

                            + + +

                            +
                            + + + + + If set to true the path in the src is used as it is. + + + The path of the script to include. If the absolute> attribute is not + set (or not set to true the path is interpreted relative to the + theme directory. For example the path of a script included using +
                            +                <script type="text/javascript" src="scripts/example.js"/>
                            +                
                            + in the a theme named my-theme at the server + http://www.example.org is altered to the absolute path + http://www.example.org/themes/published-themedir/itb/scripts/example.js. + If the absolute attribute is set to true the path is not + altered. One usecase for an absolute path is to load an script from a content delivery + network. +
                            + + The type of the script. Usally this is text/javascript. If the attribute + is not set in the layout template, it is automatically set to + text/javascript. + +
                            + + Used to include a script (usally a JavaScript). The script is either provided + a content of the element or as an external file. Embedded scripts should only be used + for small parts of code, like the code for activating jQuery plugins for some elements. + Everything which is longer than five or six lines should be put into a external file + in the scripts directory of the theme. + + + + +
                            + + + + + + + Generates a HTML5 section element. + + + + + + +
                            + + +
                            +
                            + + + + Generates a span element. + + + + + + + + + + + + + + +

                            + Generates the title in the HTML head. The other elements are allowed in the + <title> tag: +

                            +
                              +
                            • show-text
                            • +
                            • show-page-title
                            • +
                            +
                            + + + + + +
                            + + + <xsl:for-each select="showText | usePageTitle"> + <xsl:apply-templates select="."/> + <xsl:if test="position() != last()"> + <xsl:value-of select="foundry:get-setting('layout-parser', + 'title/separator', + ' - ', + ../separator)"/> + </xsl:if> + </xsl:for-each> + + + + + + + + + + + + + + +
                            \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/loaders.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/loaders.xsl new file mode 100644 index 000000000..c9f290c8b --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/loaders.xsl @@ -0,0 +1,60 @@ + + + ]> + + + + + + + + + + + + + +