Author: jleroux
Date: Fri Nov 3 12:56:26 2017 New Revision: 1814177 URL: http://svn.apache.org/viewvc?rev=1814177&view=rev Log: Puts right wiki file in themes sub folder Modified: ofbiz/tools/wiki-files/themes/README.md.html Modified: ofbiz/tools/wiki-files/themes/README.md.html URL: http://svn.apache.org/viewvc/ofbiz/tools/wiki-files/themes/README.md.html?rev=1814177&r1=1814176&r2=1814177&view=diff ============================================================================== --- ofbiz/tools/wiki-files/themes/README.md.html (original) +++ ofbiz/tools/wiki-files/themes/README.md.html Fri Nov 3 12:56:26 2017 @@ -6,43 +6,281 @@ <meta name="generator" content="pandoc" /> <title></title> <style type="text/css">code{white-space: pre;}</style> + <style type="text/css"> +div.sourceCode { overflow-x: auto; } +table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { + margin: 0; padding: 0; vertical-align: baseline; border: none; } +table.sourceCode { width: 100%; line-height: 100%; } +td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; } +td.sourceCode { padding-left: 5px; } +code > span.kw { color: #007020; font-weight: bold; } /* Keyword */ +code > span.dt { color: #902000; } /* DataType */ +code > span.dv { color: #40a070; } /* DecVal */ +code > span.bn { color: #40a070; } /* BaseN */ +code > span.fl { color: #40a070; } /* Float */ +code > span.ch { color: #4070a0; } /* Char */ +code > span.st { color: #4070a0; } /* String */ +code > span.co { color: #60a0b0; font-style: italic; } /* Comment */ +code > span.ot { color: #007020; } /* Other */ +code > span.al { color: #ff0000; font-weight: bold; } /* Alert */ +code > span.fu { color: #06287e; } /* Function */ +code > span.er { color: #ff0000; font-weight: bold; } /* Error */ +code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ +code > span.cn { color: #880000; } /* Constant */ +code > span.sc { color: #4070a0; } /* SpecialChar */ +code > span.vs { color: #4070a0; } /* VerbatimString */ +code > span.ss { color: #bb6688; } /* SpecialString */ +code > span.im { } /* Import */ +code > span.va { color: #19177c; } /* Variable */ +code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ +code > span.op { color: #666666; } /* Operator */ +code > span.bu { } /* BuiltIn */ +code > span.ex { } /* Extension */ +code > span.pp { color: #bc7a00; } /* Preprocessor */ +code > span.at { color: #7d9029; } /* Attribute */ +code > span.do { color: #ba2121; font-style: italic; } /* Documentation */ +code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ +code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ +code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ + </style> </head> <body> -<p>Three instances of OFBiz run on the OFBiz demo VM2 at https://ofbiz-vm2.apache.org.</p> -<ul> -<li>trunk: the trunk version</li> -<li>stable: the last stable version (currently 16.11)</li> -<li>old: the previous stable version (currently 13.07)</li> -</ul> -<p>This is the second instance of VM we use hence the 2 in its domain name. The root of https://ofbiz-vm2.apache.org is the so called bigfiles directory which is actually at /home/ofbizDemo/big-files</p> -<p>We own 3 Apache sub domains</p> +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<h1 id="apache-ofbiz-themes">Apache OFBiz® Themes</h1> +<h1 id="what-is-a-theme">What is a theme</h1> +<p>A Theme is an ofbiz component that defines all elements necessary to render all information generated by the screen engine through an embedded technology. Currently themes presents in Apache OFBiz use html5/jquery/css to do that.</p> +<p>To realize this, a theme can define some properties that can be necessary, can define its own ftl macro to render the different modelScreen elements and can define its own screen decorator to prepare the final user screen structure for the technology used by the theme. # How to define it A theme is a standard component, present in the directory themes or plugins with a file definition present on widget/Theme.xml and support the <a href="http://ofbiz.apache.org/dtds/widget-theme.xsd">widget-theme.xsd</a></p> +<p>To offer the possibility for end users to select the theme through the "Select Theme Screen", the theme need to load the entity VisualTheme and one or more entries related to this theme.</p> +<h1 id="structure-of-theme.xml">Structure of Theme.xml</h1> +<p>The theme definition file help OFBiz to know what specific rendering the Theme want to use. It's composed by two definition elements and four optional blocks</p> +<h2 id="main-definition">Main definition</h2> +<p>The First mandatory element is one or several visualThemeId related to the theme Defined like that</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"> <span class="kw"><visual-themes></span> + <span class="kw"><visual-theme</span><span class="ot"> id=</span><span class="st">"MY_THEME"</span><span class="kw">/></span> + <span class="kw"></visual-themes></span></code></pre></div> +<p>You need to define in the database an entry in VisualTheme Entity for each visual-theme id defined.</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"><span class="kw"><entity-engine-xml></span> + <span class="kw"><VisualTheme</span><span class="ot"> visualThemeId=</span><span class="st">"MY_THEME"</span><span class="ot"> visualThemeSetId=</span><span class="st">"BACKOFFICE"</span><span class="ot"> description=</span><span class="st">"My theme - Example (based on flatgrey)"</span><span class="kw">/></span> +<span class="kw"></entity-engine-xml></span></code></pre></div> +<blockquote> +<p><em>Note</em>: a theme component can load one or more visual theme id. Usually only one is present.</p> +</blockquote> +<p>The second important (but not mandatory) element is <strong>implements</strong></p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"> <span class="kw"><extends</span><span class="ot"> location=</span><span class="st">"component://common-theme/widget/Theme.xml"</span><span class="kw">/></span></code></pre></div> +<p>This element indicates that your theme copies from the extend theme all information not present in its file definition. If this element isn't present in your theme, you will need to define all information present in common-theme to be sure that OFBiz misses nothing for a correct run. Otherwise some functionnalities can be broken... ><em>Note</em>: It's highly recommended to extend the common-theme to be sure that your theme works correctly and to surcharge only what you need.</p> +<p>The four following blocks are optionnal if you define an extends theme ## General properties This block contains all properties that the screen engine can use to prepare the rendering and that the theme can implement</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"> <span class="kw"><widget-properties></span><span class="co"><!--Transversal properties relative to ofbiz widget component--></span> + <span class="kw"><default-view-size</span><span class="ot"> value=</span><span class="st">"20"</span><span class="kw">/></span> + <span class="kw"><autocompleter</span> +<span class="ot"> default-view-size=</span><span class="st">"10"</span> +<span class="ot"> default-min-lenght=</span><span class="st">"2"</span> +<span class="ot"> default-delay=</span><span class="st">"300"</span> +<span class="ot"> display-return-field=</span><span class="st">"true"</span><span class="kw">/></span> + <span class="kw"><lookup</span> +<span class="ot"> position=</span><span class="st">"topleft"</span> +<span class="ot"> width=</span><span class="st">"640"</span> +<span class="ot"> height=</span><span class="st">"500"</span><span class="kw">/></span> + <span class="kw"><layered-modal</span> +<span class="ot"> width=</span><span class="st">"800"</span> +<span class="ot"> height=</span><span class="st">"600"</span><span class="kw">/></span> + <span class="kw"></widget-properties></span></code></pre></div> +<h2 id="themes-specific-properties">Theme's specific properties</h2> +<p>This block contains all properties specific to this theme. In general these are some properties present on ftl template, that are initialized by the theme and can be surchaged by another theme through the extends elements.</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"> <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"jgrowlPosition"</span><span class="ot"> value=</span><span class="st">"center"</span><span class="ot"> type=</span><span class="st">"String"</span><span class="kw">/></span><span class="co"><!--possible value: top-left, top-right, bottom-left, bottom-right, center--></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"jgrowlWidth"</span><span class="ot"> value=</span><span class="st">"800"</span><span class="ot"> type=</span><span class="st">"Integer"</span><span class="kw">/></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"jgrowlHeight"</span><span class="ot"> value=</span><span class="st">""</span><span class="ot"> type=</span><span class="st">"Integer"</span><span class="kw">/></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"jgrowlSpeed"</span><span class="ot"> value=</span><span class="st">"100"</span><span class="ot"> type=</span><span class="st">"Integer"</span><span class="kw">/></span></code></pre></div> +<h2 id="ftl-macro-library">Ftl macro library</h2> +<p>This block defines for each technology implemented by the screen engine where it can find the macro library for each model (Screen, Form, Tree, Menu)</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"> <span class="kw"><templates></span><span class="co"><!-- Freemarker template use by this theme to render widget model--></span> + <span class="kw"><template</span><span class="ot"> name=</span><span class="st">"screen"</span><span class="ot"> type=</span><span class="st">"html"</span><span class="ot"> content-type=</span><span class="st">"UTF-8"</span><span class="ot"> encoding=</span><span class="st">"none"</span><span class="ot"> encoder=</span><span class="st">"html"</span><span class="ot"> compress=</span><span class="st">"false"</span><span class="kw">></span> + <span class="kw"><template-file</span><span class="ot"> widget=</span><span class="st">"screen"</span><span class="ot"> location=</span><span class="st">"component://common-theme/template/macro/HtmlScreenMacroLibrary.ftl"</span><span class="kw">/></span> + <span class="kw"><template-file</span><span class="ot"> widget=</span><span class="st">"form"</span><span class="ot"> location=</span><span class="st">"component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"</span><span class="kw">/></span> + <span class="kw"><template-file</span><span class="ot"> widget=</span><span class="st">"tree"</span><span class="ot"> location=</span><span class="st">"component://common-theme/template/macro/HtmlTreeMacroLibrary.ftl"</span><span class="kw">/></span> + <span class="kw"><template-file</span><span class="ot"> widget=</span><span class="st">"menu"</span><span class="ot"> location=</span><span class="st">"component://common-theme/template/macro/HtmlMenuMacroLibrary.ftl"</span><span class="kw">/></span> + <span class="kw"></template></span> + ... + <span class="kw"></templates></span></code></pre></div> +<blockquote> +<p><em>Note</em>: If you want surcharge some macros, you can just create the desired macros and import the others from common-theme (at the top of file) like that : <code><#include "component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"/></code></p> +</blockquote> +<h2 id="screen-library">Screen library</h2> +<p>This block defines where OFBiz can find all official screens definitions in framework/common</p> +<p>Normally, you don't need to change this file except if you need to define a default screen style that doesn't exist OOTB. If you need to extend an existing one, you have to do it in the theme directory.</p> +<p>To define a new default screen style, you have to add it in this file, and point to the screen decorator in common-theme to define your default screen style as the default one.</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"> <span class="kw"><common-screens></span><span class="co"><!--list all common screen and decorator global to each application that each theme can be surcharge or not and use the screen present on common theme--></span> + <span class="kw"><structural-decorator</span><span class="ot"> default-location=</span><span class="st">"component://common-theme/widget/CommonScreens.xml"</span><span class="kw">></span> + <span class="kw"><screen</span><span class="ot"> name=</span><span class="st">"GlobalDecorator"</span><span class="kw">/></span> + ... + <span class="kw"></structural-decorator></span> + <span class="kw"><embed-decorator</span><span class="ot"> default-location=</span><span class="st">"component://common-theme/widget/CommonScreens.xml"</span><span class="kw">></span> + <span class="kw"><screen</span><span class="ot"> name=</span><span class="st">"FindScreenDecorator"</span><span class="kw">/></span> + <span class="kw"></embed-decorator></span> + <span class="kw"><general-screen</span><span class="ot"> default-location=</span><span class="st">"component://common-theme/widget/CommonScreens.xml"</span><span class="kw">></span> + <span class="kw"><screen</span><span class="ot"> name=</span><span class="st">"geoChart"</span><span class="kw">/></span> + ... + <span class="kw"></general-screen></span> + <span class="kw"></common-screens></span></code></pre></div> +<p>Screens are separated in three types : * structural-decorator : contains all decorators that organise the screens structures * embed-decorator : decorator used only on sub screens * general-screen : list all generic inter applications screens # The common-theme This is the root theme that contains all information to ensure a good basic theme for OFBiz. Currently it keeps all old themes system for backward compatibility with ftl template managed by the entity <strong>VisualThemeResource</strong></p> +<h1 id="create-your-own-theme">Create your own theme</h1> +<p>As a theme is a component, you can create a new theme like a plugin.</p> +<p>After creating a component, you can add the two minimal information : * Theme.xml file in <strong>plugins/my-theme/widget/</strong> with minimal information :</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"><span class="kw"><theme</span><span class="ot"> name=</span><span class="st">"my-theme"</span> +<span class="ot"> xmlns:xsi=</span><span class="st">"http://www.w3.org/2001/XMLSchema-instance"</span> +<span class="ot"> xsi:noNamespaceSchemaLocation=</span><span class="st">"http://ofbiz.apache.org/dtds/widget-theme.xsd"</span><span class="kw">></span> + <span class="kw"><visual-themes></span> + <span class="kw"><visual-theme</span><span class="ot"> id=</span><span class="st">"MY_THEME"</span><span class="ot"> display-name=</span><span class="st">"My Theme"</span><span class="kw">/></span> + <span class="kw"></visual-themes></span> +<span class="kw"></theme></span></code></pre></div> <ul> -<li>https://demo-trunk.ofbiz.apache.org</li> -<li>https://demo-stable.ofbiz.apache.org</li> -<li>https://demo-old.ofbiz.apache.org</li> +<li><p>your data file to add your visual theme in <strong>plugins/my-theme/data/</strong></p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"><span class="kw"><entity-engine-xml></span> +<span class="kw"><VisualTheme</span><span class="ot"> visualThemeId=</span><span class="st">"MY_THEME"</span><span class="ot"> visualThemeSetId=</span><span class="st">"BACKOFFICE"</span><span class="kw">/></span> +<span class="kw"></entity-engine-xml></span></code></pre></div> +<p>The presence of VisualTheme entity helps to indicate which theme is available in your instance, specially helpful for tenant installations.</p></li> </ul> -<p>All demos use a Let's Encrypt certificate. There is currently a bug which prevents Let's Encrypt certificate to renew every 3 months. So we need to do it by hand and you need to have a root access for that. This is how: <a href="http://markmail.org/message/7c3rxrqkn4kkm6dm" class="uri">http://markmail.org/message/7c3rxrqkn4kkm6dm</a></p> -<p>The Puppet configuration is at https://github.com/apache/infrastructure-puppet/blob/deployment/data/nodes/ofbiz-vm2.apache.org.yaml</p> +<p>To display your theme in OFBiz theme library, you can complete the information on each visual theme like</p> +<pre><code><theme name="my-theme" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-theme.xsd"> + <visual-themes> + <visual-theme id="MY_THEME" display-name="My Theme"> + <description>My new funny theme under nice tecnno</description> + <screenshot location="/mytheme/screenshot1.png"/> + <screenshot location="/mytheme/screenshot2.png"/> + </visual-theme> + </visual-themes> +</theme></code></pre> <blockquote> -<p><em>Note</em>: <strong>Only run the ofbiz demos using the 'ofbizDemo' user, never run as root.</strong></p> +<p><em>Note</em>: <strong>display-name</strong> and <strong>description</strong> support the flexibleStringExpander syntax</p> </blockquote> -<pre><code>To do this sudo to the ofbizDemo user: - -sudo -s -u ofbizDemo -H +<h2 id="extends-common-theme">extends common-theme</h2> +<p>This is a first step to understand how the theme system works. With your new theme, you can try to surchage different elements. To start, extends the common-theme :</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"><span class="kw"><theme</span><span class="ot"> name=</span><span class="st">"my-theme"</span> +<span class="ot"> xmlns:xsi=</span><span class="st">"http://www.w3.org/2001/XMLSchema-instance"</span> +<span class="ot"> xsi:noNamespaceSchemaLocation=</span><span class="st">"http://ofbiz.apache.org/dtds/widget-theme.xsd"</span><span class="kw">></span> + <span class="kw"><visual-themes></span> + <span class="kw"><visual-theme</span><span class="ot"> id=</span><span class="st">"MY_THEME"</span><span class="ot"> display-name=</span><span class="st">"My Theme"</span><span class="kw">></span> + <span class="kw"><description></span>My new funny theme under nice tecnno<span class="kw"></description></span> + <span class="kw"><screenshot</span><span class="ot"> location=</span><span class="st">"/mytheme/screenshot1.png"</span><span class="kw">/></span> + <span class="kw"></visual-theme></span> + <span class="kw"></visual-themes></span> + <span class="kw"><extends</span><span class="ot"> location=</span><span class="st">"component://common-theme/widget/Theme.xml"</span><span class="kw">/></span> +<span class="kw"></theme></span></code></pre></div> +<p>Now your theme should be operational, but without particularity.</p> +<p>You can surcharge a ftl macro, to do this create your own ftl macro file in <strong>plugins/my-theme/templates/macro/HtmlFormMacroLibrary.ftl</strong> with</p> +<pre class="ftl"><code><#include "component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"/> -sudo uses OTP (One Time Password), so you not only need to be registered as a sudoer (ask Infra) but also to use a tool like Donkey on Ubuntu (jleroux: I use that) to generate the OTP -Then you can start/stop as required. +<#macro renderDisplayField type imageLocation idName description title class alert inPlaceEditorUrl="" inPlaceEditorParams=""> + <#if description?has_content> + *###*${description?replace("\n", "<br />")}**<#t/> + <#else> + *#&nbsp;#*<#t/> + </#if> +</#macro></code></pre> +<p>Now indicate to your theme that you want use this library</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"><span class="kw"><theme</span><span class="ot"> name=</span><span class="st">"my-theme"</span> +<span class="ot"> xmlns:xsi=</span><span class="st">"http://www.w3.org/2001/XMLSchema-instance"</span> +<span class="ot"> xsi:noNamespaceSchemaLocation=</span><span class="st">"http://ofbiz.apache.org/dtds/widget-theme.xsd"</span><span class="kw">></span> + <span class="kw"><visual-themes></span> + <span class="kw"><visual-theme</span><span class="ot"> id=</span><span class="st">"MY_THEME"</span><span class="ot"> display-name=</span><span class="st">"My Theme"</span><span class="kw">></span> + <span class="kw"><description></span>My new funny theme under nice tecnno<span class="kw"></description></span> + <span class="kw"><screenshot</span><span class="ot"> location=</span><span class="st">"/mytheme/screenshot1.png"</span><span class="kw">/></span> + <span class="kw"></visual-theme></span> + <span class="kw"></visual-themes></span> + <span class="kw"><extends</span><span class="ot"> location=</span><span class="st">"component://common-theme/widget/Theme.xml"</span><span class="kw">/></span> + <span class="kw"><templates></span> + <span class="kw"><template</span><span class="ot"> name=</span><span class="st">"screen"</span><span class="ot"> type=</span><span class="st">"html"</span><span class="ot"> content-type=</span><span class="st">"UTF-8"</span><span class="ot"> encoding=</span><span class="st">"none"</span><span class="ot"> encoder=</span><span class="st">"html"</span><span class="ot"> compress=</span><span class="st">"false"</span><span class="kw">></span> + <span class="kw"><template-file</span><span class="ot"> widget=</span><span class="st">"form"</span><span class="ot"> location=</span><span class="st">"component://my-theme/template/macro/HtmlFormMacroLibrary.ftl"</span><span class="kw">/></span> + <span class="kw"></template></span> + <span class="kw"></templates></span> +<span class="kw"></theme></span></code></pre></div> +<p>and check the result when you select your theme. The result isn't really interesting but it's to understand how it works.</p> +<h2 id="create-from-scratch">create from scratch</h2> +<p>TODO</p> +<h1 id="backware-compatibility-with-ofbiz-16.11-and-above">Backware compatibility with OFBiz 16.11 and above</h1> +<h2 id="how-themes-worked-before">How themes worked before</h2> +<p>Before the theme management by model definition, all configurations have been present in the database through entity <strong>VisualTheme</strong> and <strong>VisualThemeRessource</strong>. These ressources were loaded in a <strong>layoutProperties</strong> variable and used directly by decorator screens and ftl templates.</p> +<h2 id="now-with-the-common-theme">Now with the common-theme</h2> +<p>All this logic is still present in the common-theme template to keep backward compatibility, but the VisualThemeRessource is now useless and properties have been migrated to the Theme definition in the part <strong>theme-properties</strong> ### Example with BlueLight The blue light theme has been these properties in VisualThemeRessource :</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"> <span class="kw"><VisualTheme</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> visualThemeSetId=</span><span class="st">"BACKOFFICE"</span><span class="ot"> description=</span><span class="st">"BlueLight Theme: breadcrumbs, drop-down menus and rounded corners"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_NAME"</span><span class="ot"> resourceValue=</span><span class="st">"BLUELIGHT"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_IMAGE_URL"</span><span class="ot"> resourceValue=</span><span class="st">"/images/ofbiz_logo.gif"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_SHORTCUT_ICON"</span><span class="ot"> resourceValue=</span><span class="st">"/images/ofbiz.ico"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_SCREENSHOT"</span><span class="ot"> resourceValue=</span><span class="st">"/bluelight/screenshot.jpg"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> -To check if the demos are being run as the ofbizDemo user: + <span class="co"><!-- CSS references --></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_STYLESHEET"</span><span class="ot"> resourceValue=</span><span class="st">"/bluelight/style.css"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HELPSTYLESHEET"</span><span class="ot"> resourceValue=</span><span class="st">"/bluelight/help.css"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_DOCBOOKSTYLESHEET"</span><span class="ot"> resourceValue=</span><span class="st">"/bluelight/webapp/bluelight/docbook.css"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_STYLESHEET"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/plugins/asmselect/jquery.asmselect-1.0.4a-beta.css"</span><span class="ot"> sequenceId=</span><span class="st">"02"</span><span class="kw">/></span> -ps aux | grep ofbizDemo + <span class="co"><!-- Javascript references --></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/jquery-1.11.0.min.js"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/jquery-migrate-1.2.1.js"</span><span class="ot"> sequenceId=</span><span class="st">"02"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/ui/js/jquery-ui-1.10.3.min.js"</span><span class="ot"> sequenceId=</span><span class="st">"03"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/plugins/asmselect/jquery.asmselect-1.0.4a-beta.js"</span><span class="ot"> sequenceId=</span><span class="st">"05"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/plugins/datetimepicker/jquery-ui-timepicker-addon.min-1.4.3.js"</span><span class="ot"> sequenceId=</span><span class="st">"07"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/plugins/fjTimer/jquerytimer-min.js"</span><span class="ot"> sequenceId=</span><span class="st">"09"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/plugins/jquery.maskedinput-1.3.1.min.js"</span><span class="ot"> sequenceId=</span><span class="st">"10"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/plugins/jeditable/jquery.jeditable.js"</span><span class="ot"> sequenceId=</span><span class="st">"11"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/jquery/plugins/validate/jquery.validate.min.js"</span><span class="ot"> sequenceId=</span><span class="st">"12"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/images/OpenLayers-2.13.1.js"</span><span class="ot"> sequenceId=</span><span class="st">"13"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/util/OfbizUtil.js"</span><span class="ot"> sequenceId=</span><span class="st">"15"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/util/fieldlookup.js"</span><span class="ot"> sequenceId=</span><span class="st">"16"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/plugins/date/date.format-1.2.3-min.js"</span><span class="ot"> sequenceId=</span><span class="st">"17"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/plugins/date/date.timezone-min.js"</span><span class="ot"> sequenceId=</span><span class="st">"18"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/util/miscAjaxFunctions.js"</span><span class="ot"> sequenceId=</span><span class="st">"19"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/util/selectMultipleRelatedValues.js"</span><span class="ot"> sequenceId=</span><span class="st">"20"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/util/util.js"</span><span class="ot"> sequenceId=</span><span class="st">"21"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/common/js/plugins/date/FromThruDateCheck.js"</span><span class="ot"> sequenceId=</span><span class="st">"22"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_JAVASCRIPT"</span><span class="ot"> resourceValue=</span><span class="st">"/bluelight/dropdown.js"</span><span class="ot"> sequenceId=</span><span class="st">"30"</span><span class="kw">/></span> -The first column on the left tell you the username the demo is -being run as - it should say ofbizDemo (UID) or 9997 (GID) ! - -Type 'exit' to exit the ofbizDemo user and return to your normal user.</code></pre> -<p>Also note that the demos are usually updated and started/stopped automatically using the check-svn-update.sh script in this directory, it is run by an ofbiz cron job every 24 hours at 3 AM. You should therefore only need to start/stop manually if there is a problem.</p> -<p>If you want to restart only a single instance you can respectively use</p> -<p>trunk-manual-nicely.sh stable-manual-nicely.sh old-manual-nicely.sh</p> + <span class="co"><!-- ftl references --></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_HDR_TMPLT_LOC"</span><span class="ot"> resourceValue=</span><span class="st">"component://bluelight/template/Header.ftl"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_FTR_TMPLT_LOC"</span><span class="ot"> resourceValue=</span><span class="st">"component://bluelight/template/Footer.ftl"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_NAV_OPEN_TMPLT"</span><span class="ot"> resourceValue=</span><span class="st">"component://bluelight/template/AppBarOpen.ftl"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_NAV_CLOSE_TMPLT"</span><span class="ot"> resourceValue=</span><span class="st">"component://bluelight/template/AppBarClose.ftl"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span> + <span class="kw"><VisualThemeResource</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> resourceTypeEnumId=</span><span class="st">"VT_MSG_TMPLT_LOC"</span><span class="ot"> resourceValue=</span><span class="st">"component://bluelight/template/Messages.ftl"</span><span class="ot"> sequenceId=</span><span class="st">"01"</span><span class="kw">/></span></code></pre></div> +<p>Now it's just</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"> <span class="kw"><VisualTheme</span><span class="ot"> visualThemeId=</span><span class="st">"BLUELIGHT"</span><span class="ot"> visualThemeSetId=</span><span class="st">"BACKOFFICE"</span><span class="kw">/></span></code></pre></div> +<p>And on theme definition</p> +<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"> <span class="kw"><theme-properties></span> + <span class="co"><!--javascript lib--></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"VT_HDR_JAVASCRIPT['add']"</span><span class="ot"> value=</span><span class="st">"/bluelight/dropdown.js"</span><span class="ot"> sequenceId=</span><span class="st">"30"</span><span class="kw">/></span> + <span class="co"><!--Css style--></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"VT_STYLESHEET['add']"</span><span class="ot"> value=</span><span class="st">"/bluelight/style.css"</span><span class="kw">/></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"VT_HELPSTYLESHEET['add']"</span><span class="ot"> value=</span><span class="st">"/bluelight/help.css"</span><span class="kw">/></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"VT_DOCBOOKSTYLESHEET['add']"</span><span class="ot"> value=</span><span class="st">"/bluelight/webapp/bluelight/docbook.css"</span><span class="kw">/></span> + <span class="co"><!--template location--></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"VT_HDR_TMPLT_LOC"</span><span class="ot"> value=</span><span class="st">"component://bluelight/template/Header.ftl"</span><span class="kw">/></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"VT_FTR_TMPLT_LOC"</span><span class="ot"> value=</span><span class="st">"component://bluelight/template/Footer.ftl"</span><span class="kw">/></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"VT_NAV_OPEN_TMPLT"</span><span class="ot"> value=</span><span class="st">"component://bluelight/template/AppBarOpen.ftl"</span><span class="kw">/></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"VT_NAV_CLOSE_TMPLT"</span><span class="ot"> value=</span><span class="st">"component://bluelight/template/AppBarClose.ftl"</span><span class="kw">/></span> + <span class="kw"><property</span><span class="ot"> name=</span><span class="st">"VT_MSG_TMPLT_LOC"</span><span class="ot"> value=</span><span class="st">"component://bluelight/template/Messages.ftl"</span><span class="kw">/></span> + <span class="kw"></theme-properties></span></code></pre></div> +<p>Values with <strong>/images/...</strong> have been moved to the common-theme that bluelight extends, the theme definition keeps only what the theme adds to the extended theme.</p> +<blockquote> +<p><em>Note</em> property name supports the FlexibleMapAccessor syntax, so you can continue to populate a list (VT_STYLESHEET['add']), reset a list (VT_STYLESHEET[]) or add an element on the top list (VT_STYLESHEET[+0]) because some time the order libraries loading is important</p> +</blockquote> +<h3 id="migrate-you-own-theme">Migrate you own theme</h3> +<p>Easily, create you Theme.xml and move your VisualThemeResource in <strong>theme-properties</strong> like in the BlueLight example above. Maybe you will need to update your template because the modelTheme return ressources not always as list. So : <code><property name="VT_HDR_TMPLT_LOC" value="component://bluelight/template/Header.ftl"/></code> -> return a String with <code>component://bluelight/template/Header.ftl</code> <code><property name="VT_STYLESHEET['add'] value="..."</code> -> return a List<String></p> </body> </html> |
Free forum by Nabble | Edit this page |