svn commit: r1806147 - in /ofbiz/ofbiz-framework/trunk/themes/common: data/ template/includes/ template/macro/ widget/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1806147 - in /ofbiz/ofbiz-framework/trunk/themes/common: data/ template/includes/ template/macro/ widget/

nmalin
Author: nmalin
Date: Fri Aug 25 09:45:55 2017
New Revision: 1806147

URL: http://svn.apache.org/viewvc?rev=1806147&view=rev
Log:
Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Five step these step break all the UI
#7 Correct the common screens and ftl template in common-theme to use theme's properties

Modified:
    ofbiz/ofbiz-framework/trunk/themes/common/data/CommonThemeData.xml
    ofbiz/ofbiz-framework/trunk/themes/common/template/includes/AjaxAutocompleteOptions.ftl
    ofbiz/ofbiz-framework/trunk/themes/common/template/includes/Messages.ftl
    ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl
    ofbiz/ofbiz-framework/trunk/themes/common/widget/CommonScreens.xml
    ofbiz/ofbiz-framework/trunk/themes/common/widget/HelpScreens.xml
    ofbiz/ofbiz-framework/trunk/themes/common/widget/LookupScreens.xml

Modified: ofbiz/ofbiz-framework/trunk/themes/common/data/CommonThemeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/data/CommonThemeData.xml?rev=1806147&r1=1806146&r2=1806147&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/data/CommonThemeData.xml (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/data/CommonThemeData.xml Fri Aug 25 09:45:55 2017
@@ -19,7 +19,5 @@ under the License.
 -->
 
 <entity-engine-xml>
-    <!--Currently disable
     <VisualTheme visualThemeId="COMMON" visualThemeSetId="BACKOFFICE" description="Common Theme"/>
-    -->
 </entity-engine-xml>

Modified: ofbiz/ofbiz-framework/trunk/themes/common/template/includes/AjaxAutocompleteOptions.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/template/includes/AjaxAutocompleteOptions.ftl?rev=1806147&r1=1806146&r2=1806147&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/template/includes/AjaxAutocompleteOptions.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/template/includes/AjaxAutocompleteOptions.ftl Fri Aug 25 09:45:55 2017
@@ -35,11 +35,6 @@ under the License.
 <script type="text/javascript">
     var autocomp = [
         <#if autocompleteOptions?has_content>
-          <#if !displayReturnField??>
-            <#assign displayReturnField = Static[
-                "org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue(
-                "widget", "widget.autocompleter.displayReturnField", delegator)>
-          </#if>
           <#list autocompleteOptions as autocompleteOption>
               {
                 <#assign displayString = ""/>
@@ -54,7 +49,7 @@ under the License.
                     </#if>
                   </#if>
                 </#list>
-                <#if ("Y" == displayReturnField)>
+                <#if modelTheme.getAutocompleterDisplayReturnField()>
                   <#assign displayString = displayString +  "[" + returnField + "]">
                 </#if>
                   "id": "${returnField}",

Modified: ofbiz/ofbiz-framework/trunk/themes/common/template/includes/Messages.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/template/includes/Messages.ftl?rev=1806147&r1=1806146&r2=1806147&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/template/includes/Messages.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/template/includes/Messages.ftl Fri Aug 25 09:45:55 2017
@@ -17,6 +17,7 @@ specific language governing permissions
 under the License.
 -->
 <#escape x as x?html>
+<#assign modelTheme = visualTheme.getModelTheme()>
   <#if requestAttributes.errorMessageList?has_content><#assign errorMessageList=requestAttributes.errorMessageList></#if>
   <#if requestAttributes.eventMessageList?has_content><#assign eventMessageList=requestAttributes.eventMessageList></#if>
   <#if requestAttributes.serviceValidationException??><#assign serviceValidationException = requestAttributes.serviceValidationException></#if>
@@ -50,10 +51,10 @@ under the License.
       </#if>
     </div>
   </#if>
-  <#assign jGrowlPosition = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget", "widget.jgrowl.position", delegator)>
-  <#assign jGrowlWidth = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget", "widget.jgrowl.width", delegator)>
-  <#assign jGrowlHeight = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget", "widget.jgrowl.height", delegator)>
-  <#assign jGrowlSpeed = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget", "widget.jgrowl.speed", delegator)>
+  <#assign jGrowlPosition = modelTheme.getProperty("jgrowl.position")>
+  <#assign jGrowlWidth = modelTheme.getProperty("jgrowl.width")>
+  <#assign jGrowlHeight = modelTheme.getProperty("jgrowl.height")>
+  <#assign jGrowlSpeed = modelTheme.getProperty("jgrowl.speed")>
 
   <script>showjGrowl(
           "${uiLabelMap.CommonShowAll}", "${uiLabelMap.CommonCollapse}", "${uiLabelMap.CommonHideAllNotifications}",
@@ -72,10 +73,10 @@ under the License.
       </#list>
     </#if>
   </div>
-  <#assign jGrowlPosition = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget", "widget.jgrowl.position", delegator)>
-  <#assign jGrowlWidth = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget", "widget.jgrowl.width", delegator)>
-  <#assign jGrowlHeight = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget", "widget.jgrowl.height", delegator)>
-  <#assign jGrowlSpeed = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget", "widget.jgrowl.speed", delegator)>
+  <#assign jGrowlPosition = visualTheme.getModelTheme().getProperty("jgrowl.position")>
+  <#assign jGrowlWidth = visualTheme.getModelTheme().getProperty("jgrowl.width")>
+  <#assign jGrowlHeight = visualTheme.getModelTheme().getProperty("jgrowl.height")>
+  <#assign jGrowlSpeed = visualTheme.getModelTheme().getProperty("jgrowl.speed")>
   <script>showjGrowl(
           "${uiLabelMap.CommonShowAll}", "${uiLabelMap.CommonCollapse}", "${uiLabelMap.CommonHideAllNotifications}",
           "${jGrowlPosition}", "${jGrowlWidth}", "${jGrowlHeight}", "${jGrowlSpeed}");</script>

Modified: ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl?rev=1806147&r1=1806146&r2=1806147&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl Fri Aug 25 09:45:55 2017
@@ -69,7 +69,7 @@ under the License.
     require
   /><#t/>
   <#if ajaxEnabled?has_content && ajaxEnabled>
-    <#assign defaultMinLength = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValueFromDelegatorName("widget", "widget.autocompleter.defaultMinLength", delegatorName)>
+    <#assign defaultMinLength = visualTheme.getModelTheme().getAutocompleterDefaultDelay()>
     <#assign defaultDelay = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValueFromDelegatorName("widget", "widget.autocompleter.defaultDelay", delegatorName)>
     <script language="JavaScript" type="text/javascript">ajaxAutoCompleter('${ajaxUrl}', false, ${defaultMinLength!2}, ${defaultDelay!300});</script><#lt/>
   </#if>

Modified: ofbiz/ofbiz-framework/trunk/themes/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/widget/CommonScreens.xml?rev=1806147&r1=1806146&r2=1806147&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/widget/CommonScreens.xml (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/widget/CommonScreens.xml Fri Aug 25 09:45:55 2017
@@ -107,9 +107,6 @@ under the License.
     -->
     <screen name="ajaxAutocompleteOptions">
         <section>
-            <actions>
-                <set field="autocompleteOptions" from-field="parameters.autocompleteOptions" />
-            </actions>
             <widgets>
                 <decorator-screen name="AjaxGlobalDecorator">
                     <decorator-section name="body">
@@ -125,14 +122,6 @@ under the License.
     <screen name="GlobalActions">
         <section>
             <actions>
-                <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" global="true" />
-                <service service-name="getVisualThemeResources">
-                    <field-map field-name="visualThemeId" />
-                    <field-map field-name="themeResources" from-field="layoutSettings" />
-                </service>
-                <set field="layoutSettings" from-field="themeResources" default-value="${layoutSettings}" global="true" />
-
-                <set field="initialLocaleComplete" type="String" value="${groovy:parameters?.userLogin?.lastLocale}" default-value="${groovy:locale.toString()}" />
                 <set field="layoutSettings.javaScripts[+0]" value="${groovy: org.apache.ofbiz.common.JsLanguageFilesMapping.datejs.getFilePath(initialLocaleComplete)}" global="true" />
                 <set field="layoutSettings.javaScripts[+0]" value="${groovy: org.apache.ofbiz.common.JsLanguageFilesMapping.jquery.getFilePath(initialLocaleComplete)}" global="true" />
                 <set field="layoutSettings.javaScripts[+0]" value="${groovy: org.apache.ofbiz.common.JsLanguageFilesMapping.validation.getFilePath(initialLocaleComplete)}" global="true" />
@@ -141,10 +130,6 @@ under the License.
                 <set field="layoutSettings.javaScripts[]" value="/images/jquery/plugins/Readmore.js-master/readmore.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/jquery/plugins/jquery-jgrowl/1.4.1/jquery.jgrowl.min.js" global="true"/>
                 <set field="layoutSettings.styleSheets[+0]" value="/images/jquery/plugins/jquery-jgrowl/1.4.1/jquery.jgrowl.min.css" global="true" />
-                <!-- Set default user locale from browser -->
-                <set field="layoutSettings.javaScripts[+0]" value="/images/setUserLocale.js"/>
-                <set field="layoutSettings.javaScripts[+0]" value="/images/moment-timezone-with-data.min.js" global="true"/>
-                <set field="layoutSettings.javaScripts[+0]" value="/images/moment-with-locales.min.js" global="true"/>
             </actions>
             <widgets />
         </section>
@@ -158,13 +143,13 @@ under the License.
                 <section>
                     <actions>
                         <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" default-value="main" global="true" />
-                        <set field="iconsLocation" from-field="layoutSettings.VT_ICONS_LOC[0]" default-value="/images/icons/famfamfam" global="true" />
-                        <set field="headerTemplateLocation" from-field="layoutSettings.VT_HDR_TMPLT_LOC[0]" />
-                        <set field="footerTemplateLocation" from-field="layoutSettings.VT_FTR_TMPLT_LOC[0]" />
-                        <set field="appbarTemplateLocation" from-field="layoutSettings.VT_NAV_TMPLT_LOC[0]" />
-                        <set field="appbarOpenTemplateLocation" from-field="layoutSettings.VT_NAV_OPEN_TMPLT[0]" />
-                        <set field="appbarCloseTemplateLocation" from-field="layoutSettings.VT_NAV_CLOSE_TMPLT[0]" />
-                        <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC[0]" />
+                        <set field="iconsLocation" from-field="layoutSettings.VT_ICONS_LOC" default-value="/images/icons/famfamfam" global="true" />
+                        <set field="headerTemplateLocation" from-field="layoutSettings.VT_HDR_TMPLT_LOC" />
+                        <set field="footerTemplateLocation" from-field="layoutSettings.VT_FTR_TMPLT_LOC" />
+                        <set field="appbarTemplateLocation" from-field="layoutSettings.VT_NAV_TMPLT_LOC" />
+                        <set field="appbarOpenTemplateLocation" from-field="layoutSettings.VT_NAV_OPEN_TMPLT" />
+                        <set field="appbarCloseTemplateLocation" from-field="layoutSettings.VT_NAV_CLOSE_TMPLT" />
+                        <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC" />
                         <set field="layoutSettings.suppressTab" value="ofbizsetup"/><!-- diseable ofbiz setup by default -->
                     </actions>
                     <widgets />
@@ -358,16 +343,11 @@ under the License.
                         <set field="userPreferences" from-field="prefResult.userPrefMap" global="true"/>
 
                         <property-map resource="general" map-name="generalProperties" global="true"/>
-                        <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" global="true"/>
                         <set field="defaultOrganizationPartyId" from-field="userPreferences.ORGANIZATION_PARTY" global="true"/>
-                        <service service-name="getVisualThemeResources">
-                            <field-map field-name="visualThemeId"/>
-                            <field-map field-name="themeResources" from-field="layoutSettings"/>
-                        </service>
 
-                        <set field="layoutSettings" from-field="themeResources" default-value="${layoutSettings}" global="true"/>
+                        <set field="layoutSettings" from-field="modelTheme.getThemeResources()" default-value="${layoutSettings}" global="true"/>
 
-                        <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC[0]" default-value="component://common-theme/template/includes/Messages.ftl"/>
+                        <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC" default-value="component://common-theme/template/includes/Messages.ftl"/>
                     </actions>
                     <widgets>
                         <section>
@@ -415,6 +395,8 @@ under the License.
                     <actions>
                         <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                         <set field="searchType" from-field="parameters.searchType" default-value="${searchType}"/>
+                        <set field="autocompleterViewSize" from-field="parameters.autocompleterViewSize"
+                             default-value="${groovy: theme.getModelTheme().getAutocompleterDefaultViewSize()}"/>
                         <script location="component://common/groovyScripts/FindAutocompleteOptions.groovy"/>
                     </actions>
                     <widgets>
@@ -546,7 +528,7 @@ under the License.
                     <decorator-section name="body">
                         <section>
                             <actions>
-                                <set field="loginTemplateLocation" from-field="layoutSettings.VT_LOGIN_TMPLT_LOC[0]" default-value="component://common-theme/template/Login.ftl"/>
+                                <set field="loginTemplateLocation" from-field="layoutSettings.VT_LOGIN_TMPLT_LOC" default-value="component://common-theme/template/Login.ftl"/>
                             </actions>
                             <widgets />
                         </section>

Modified: ofbiz/ofbiz-framework/trunk/themes/common/widget/HelpScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/widget/HelpScreens.xml?rev=1806147&r1=1806146&r2=1806147&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/widget/HelpScreens.xml (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/widget/HelpScreens.xml Fri Aug 25 09:45:55 2017
@@ -26,18 +26,8 @@ under the License.
             <actions>
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
-                <service service-name="getUserPreferenceGroup" result-map="prefResult">
-                    <field-map field-name="userPrefGroupTypeId" value="GLOBAL_PREFERENCES"/>
-                </service>
-                <set field="userPreferences" from-field="prefResult.userPrefMap" global="true"/>
                 <set field="lookupType" value="HELP"/>
-                <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" global="true"/>
-                <service service-name="getVisualThemeResources">
-                    <field-map field-name="visualThemeId"/>
-                    <field-map field-name="themeResources" from-field="layoutSettings"/>
-                </service>
-                <set field="layoutSettings" from-field="themeResources" default-value="${layoutSettings}" global="true"/>
-                <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC[0]" default-value="component://common-theme/template/includes/Messages.ftl"/>
+                <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC" default-value="component://common-theme/template/includes/Messages.ftl"/>
             </actions>
             <widgets>
                 <platform-specific><html><html-template location="component://common-theme/template/includes/Lookup.ftl"/></html></platform-specific>
@@ -51,8 +41,7 @@ under the License.
                         </container>
                     </container>
                 </container>
-                <container style="clear"></container>
-
+                <container style="clear"/>
                 <platform-specific><html><html-template location="component://common-theme/template/includes/LookupFooter.ftl"/></html></platform-specific>
             </widgets>
         </section>
@@ -155,12 +144,6 @@ under the License.
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="CommonExtUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="contentId" from-field="parameters.contentId" default-value="${contentId}"/>
-                <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" global="true"/>
-                <service service-name="getVisualThemeResources">
-                    <field-map field-name="visualThemeId"/>
-                    <field-map field-name="themeResources" from-field="layoutSettings"/>
-                </service>
-                <set field="layoutSettings" from-field="themeResources" default-value="${layoutSettings}" global="true"/>
             </actions>
             <widgets>
                 <container id="Document">

Modified: ofbiz/ofbiz-framework/trunk/themes/common/widget/LookupScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/widget/LookupScreens.xml?rev=1806147&r1=1806146&r2=1806147&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/widget/LookupScreens.xml (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/widget/LookupScreens.xml Fri Aug 25 09:45:55 2017
@@ -96,9 +96,7 @@ under the License.
                 <set field="parameters.presentation" value="window"/>
                 <entity-one entity-name="WebSite" value-field="webSite"/>
                 <set field="visualThemeSetId" from-field="webSite.visualThemeSetId" default-value="BACKOFFICE" />
-                <entity-condition entity-name="VisualTheme" list="visualThemes">
-                    <condition-expr field-name="visualThemeSetId" from-field="visualThemeSetId" />
-                </entity-condition>
+                <set field="visualThemes" value="${groovy: org.apache.ofbiz.widget.model.ThemeFactory.getAvailableThemes(delegator, visualThemeSetId)}"/>
             </actions>
             <widgets>
                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">