You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2006/08/10 22:08:25 UTC
svn commit: r430511 - in /incubator/ofbiz/trunk:
applications/accounting/webapp/accounting/chartofaccounts/
framework/common/config/ framework/common/webcommon/includes/
framework/widget/src/org/ofbiz/widget/fo/
Author: jacopoc
Date: Thu Aug 10 13:08:24 2006
New Revision: 430511
URL: http://svn.apache.org/viewvc?rev=430511&view=rev
Log:
Very first draft of the implementation of fo widget styles applied using a properties file.
Now the Chart of Accounts report looks pretty good.
Added:
incubator/ofbiz/trunk/framework/common/config/fo-styles.properties (with props)
Modified:
incubator/ofbiz/trunk/applications/accounting/webapp/accounting/chartofaccounts/GlAccountForms.xml
incubator/ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl
incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java
Modified: incubator/ofbiz/trunk/applications/accounting/webapp/accounting/chartofaccounts/GlAccountForms.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/webapp/accounting/chartofaccounts/GlAccountForms.xml?rev=430511&r1=430510&r2=430511&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/accounting/webapp/accounting/chartofaccounts/GlAccountForms.xml (original)
+++ incubator/ofbiz/trunk/applications/accounting/webapp/accounting/chartofaccounts/GlAccountForms.xml Thu Aug 10 13:08:24 2006
@@ -106,8 +106,8 @@
<field name="glAccountId" widget-style="selectBox">
<drop-down>
- <entity-options entity-name="GlAccount" description="${accountName}">
- <entity-order-by field-name="accountName"/>
+ <entity-options entity-name="GlAccount" description="${glAccountId}: ${accountName}">
+ <entity-order-by field-name="glAccountId"/>
</entity-options>
</drop-down>
</field>
@@ -139,17 +139,17 @@
</actions>
<!--auto-fields-entity entity-name="GlAccount" default-field-type="display"/-->
- <field name="glAccountId" title="${uiLabelMap.CommonEdit}" widget-style="buttontext">
+ <field name="glAccountId" title="${uiLabelMap.CommonEdit}" widget-style="buttontext" title-area-style="tableheadsmall">
<hyperlink also-hidden="false" description="${glAccountId}" target="GlAccountNavigate?glAccountId=${glAccountId}"/>
</field>
- <field name="accountName"><display/></field>
+ <field name="accountName" title-area-style="tableheadwide"><display/></field>
<field name="glAccountTypeId"><display-entity entity-name="GlAccountType"/></field>
<field name="glAccountClassId"><display-entity entity-name="GlAccountClass"/></field>
- <field name="glResourceTypeId"><display-entity entity-name="GlResourceType"></display-entity></field>
- <field name="glXbrlClassId"><display-entity entity-name="GlXbrlClass"></display-entity></field>
- <field name="parentGlAccountId"><display-entity entity-name="GlAccount" description="${accountName}[${glAccountId}]" key-field-name="glAccountId"></display-entity></field>
+ <field name="glResourceTypeId" title-area-style="tableheadsmall"><display-entity entity-name="GlResourceType"></display-entity></field>
+ <field name="glXbrlClassId" title-area-style="tableheadsmall"><display-entity entity-name="GlXbrlClass"></display-entity></field>
+ <field name="parentGlAccountId" title-area-style="tableheadwide"><display-entity entity-name="GlAccount" description="${accountName}[${glAccountId}]" key-field-name="glAccountId"></display-entity></field>
<field name="accountCode"><hidden/></field>
- <field name="postedBalance"><display type="currency" currency="${defaultCurrencyUomId}"/></field>
+ <field name="postedBalance" widget-area-style="tabletextright" widget-style="tabletext" title-area-style="tableheadsmall"><display type="currency" currency="${defaultCurrencyUomId}"/></field>
</form>
<form name="EditGlAccount" type="single" target="updateGlAccount" title="" default-map-name="glAccount"
Added: incubator/ofbiz/trunk/framework/common/config/fo-styles.properties
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/common/config/fo-styles.properties?rev=430511&view=auto
==============================================================================
--- incubator/ofbiz/trunk/framework/common/config/fo-styles.properties (added)
+++ incubator/ofbiz/trunk/framework/common/config/fo-styles.properties Thu Aug 10 13:08:24 2006
@@ -0,0 +1,21 @@
+#####################################################################
+# Copyright 2001-2006 The Apache Software Foundation
+#
+# Licensed 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.
+#####################################################################
+tabletext=border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\"
+tabletextright=border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\" text-align=\"right\"
+tableheadverysmall=column-width=\"0.3in\"
+tableheadsmall=column-width=\"0.5in\"
+tableheadmedium=column-width=\"1.5in\"
+tableheadwide=column-width=\"3in\"
Propchange: incubator/ofbiz/trunk/framework/common/config/fo-styles.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/ofbiz/trunk/framework/common/config/fo-styles.properties
------------------------------------------------------------------------------
svn:keywords = "Date Rev Author URL Id"
Propchange: incubator/ofbiz/trunk/framework/common/config/fo-styles.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl?rev=430511&r1=430510&r2=430511&view=diff
==============================================================================
--- incubator/ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl (original)
+++ incubator/ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl Thu Aug 10 13:08:24 2006
@@ -37,7 +37,7 @@
</fo:simple-page-master>
</fo:layout-master-set>
- <fo:page-sequence master-reference="${pageLayoutName?default("simple-portrait")}" font-size="9pt">
+ <fo:page-sequence master-reference="${pageLayoutName?default("simple-portrait")}" font-size="8pt">
<#-- Header -->
<fo:static-content flow-name="xsl-region-before" font-size="8pt">
<fo:table>
Modified: incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java?rev=430511&r1=430510&r2=430511&view=diff
==============================================================================
--- incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java (original)
+++ incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java Thu Aug 10 13:08:24 2006
@@ -84,17 +84,23 @@
//buffer.append(' ');
}
+ private String getFoStyle(String styleName) {
+ String value = UtilProperties.getPropertyValue("fo-styles.properties", styleName);
+ if (value.equals(styleName)) {
+ return "";
+ }
+ return value;
+ }
+
private void makeBlockString(StringBuffer buffer, String widgetStyle, String text) {
- buffer.append("<fo:block>");
- buffer.append(text);
- buffer.append("</fo:block>");
- /*
+ buffer.append("<fo:block");
if (UtilValidate.isNotEmpty(widgetStyle)) {
- buffer.append(" class=\"");
- buffer.append(widgetStyle);
- buffer.append("\"");
+ buffer.append(" ");
+ buffer.append(getFoStyle(widgetStyle));
}
- */
+ buffer.append(">");
+ buffer.append(text);
+ buffer.append("</fo:block>");
}
public void renderDisplayField(StringBuffer buffer, Map context, DisplayField displayField) {
@@ -205,7 +211,13 @@
if (childFieldType == ModelFormField.FieldInfo.HIDDEN || childFieldType == ModelFormField.FieldInfo.IGNORED) {
continue;
}
- buffer.append("<fo:table-column/>");
+ buffer.append("<fo:table-column");
+ String areaStyle = childField.getTitleAreaStyle();
+ if (UtilValidate.isNotEmpty(areaStyle)) {
+ buffer.append(" ");
+ buffer.append(getFoStyle(areaStyle));
+ }
+ buffer.append("/>");
this.appendWhitespace(buffer);
}
this.appendWhitespace(buffer);
@@ -266,7 +278,13 @@
}
public void renderFormatItemRowCellOpen(StringBuffer buffer, Map context, ModelForm modelForm, ModelFormField modelFormField) {
- buffer.append("<fo:table-cell border-left=\"solid black\" border-right=\"solid black\" padding-left=\"2pt\" padding-top=\"2pt\">");
+ buffer.append("<fo:table-cell ");
+ String areaStyle = modelFormField.getWidgetAreaStyle();
+ if (UtilValidate.isEmpty(areaStyle)) {
+ areaStyle = "tabletext";
+ }
+ buffer.append(getFoStyle(areaStyle));
+ buffer.append(">");
this.appendWhitespace(buffer);
}