Author: nmalin
Date: Sun May 29 18:38:26 2016 New Revision: 1746045 URL: http://svn.apache.org/viewvc?rev=1746045&view=rev Log: Add xls screen renderer to convert a screen definition like an html flow directly ready by a spreadsheet application In addition, add an export example button on FindExample screen and add complete macro ftl renderer unit test. Issue OFBIZ-6931 proposed by Leila Mekika. Thanks to her, jacques and pierre for theirs remarks. Added: ofbiz/trunk/framework/common/template/includes/Simple.xls.ftl (with props) ofbiz/trunk/framework/widget/templates/xlsFormMacroLibrary.ftl (with props) ofbiz/trunk/framework/widget/templates/xlsScreenMacroLibrary.ftl (with props) ofbiz/trunk/framework/widget/templates/xlsTreeMacroLibrary.ftl (with props) Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml ofbiz/trunk/framework/common/webcommon/WEB-INF/handlers-controller.xml ofbiz/trunk/framework/common/widget/CommonScreens.xml ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml ofbiz/trunk/framework/webtools/widget/Menus.xml ofbiz/trunk/framework/widget/config/widget.properties ofbiz/trunk/framework/widget/dtd/widget-screen.xsd ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java ofbiz/trunk/specialpurpose/example/webapp/example/WEB-INF/controller.xml ofbiz/trunk/specialpurpose/example/widget/example/CommonScreens.xml ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original) +++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Sun May 29 18:38:26 2016 @@ -12556,6 +12556,10 @@ <value xml:lang="fr">Voir en xml</value> <value xml:lang="zh">æXMLæ ¼å¼æµè§</value> </property> + <property key="CommonViewAsXls"> + <value xml:lang="en">View as spreadsheet</value> + <value xml:lang="fr">Voir en tableur</value> + </property> <property key="CommonViewBlocked"> <value xml:lang="ar">ت٠Øظر اÙدخÙ٠عÙÙ Ùذ٠اÙصÙØØ©</value> <value xml:lang="de">Zugriff auf diese Sicht wurde blockiert.</value> Added: ofbiz/trunk/framework/common/template/includes/Simple.xls.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/template/includes/Simple.xls.ftl?rev=1746045&view=auto ============================================================================== --- ofbiz/trunk/framework/common/template/includes/Simple.xls.ftl (added) +++ ofbiz/trunk/framework/common/template/includes/Simple.xls.ftl Sun May 29 18:38:26 2016 @@ -0,0 +1,40 @@ +<#-- +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. +--> + +<#assign docLangAttr = locale.toString()?replace("_", "-")> +<#assign langDir = "ltr"> +<#if "ar.iw"?contains(docLangAttr?substring(0, 2))><#assign langDir = "rtl"></#if> + +<html lang="${docLangAttr}" dir="${langDir}" xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +</head> + +<body> + <style> + .txf {mso-number-format:\@} <#-- Text format--> + .cf {mso-number-format:"\#\#0.00"} <#-- currency format--> + .nf {mso-number-format:"0.00"} <#-- number format--> + .tf {mso-number-format:"HH:mm:ss"} <#-- time format--> + .df {mso-number-format:"yyyy-MM-dd"} <#-- date format--> + .dtf {mso-number-format:"yyyy-MM-dd HH:mm:ss"} <#-- date-time format--> + </style> +${sections.render("body")} +</body> +</html> Propchange: ofbiz/trunk/framework/common/template/includes/Simple.xls.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/common/template/includes/Simple.xls.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/common/template/includes/Simple.xls.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/handlers-controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/handlers-controller.xml?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/handlers-controller.xml (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/handlers-controller.xml Sun May 29 18:38:26 2016 @@ -39,6 +39,7 @@ under the License. <handler name="screenxml" type="view" class="org.ofbiz.widget.renderer.macro.MacroScreenViewHandler"/> <handler name="screentext" type="view" class="org.ofbiz.widget.renderer.macro.MacroScreenViewHandler"/> <handler name="screencsv" type="view" class="org.ofbiz.widget.renderer.macro.MacroScreenViewHandler"/> + <handler name="screenxls" type="view" class="org.ofbiz.widget.renderer.macro.MacroScreenViewHandler"/> <handler name="screenfop" type="view" class="org.ofbiz.widget.renderer.fo.ScreenFopViewHandler"/> <handler name="jsp" type="view" class="org.ofbiz.webapp.view.JspViewHandler"/> <handler name="http" type="view" class="org.ofbiz.webapp.view.HttpViewHandler"/> Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Sun May 29 18:38:26 2016 @@ -488,6 +488,7 @@ under the License. <xml><html-template location="component://common/template/includes/MinimalDecorator.ftl"/></xml> <text><html-template location="component://common/template/includes/MinimalDecorator.ftl"/></text> <csv><html-template location="component://common/template/includes/MinimalDecorator.ftl"/></csv> + <xls><html-template location="component://common/template/includes/Simple.xls.ftl"/></xls> </platform-specific> </widgets> </section> Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml (original) +++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml Sun May 29 18:38:26 2016 @@ -557,7 +557,9 @@ under the License. <request-map uri="WebtoolsLayoutDemoFop"><security https="true" auth="true"/><response name="success" type="view" value="WebtoolsLayoutDemoFop"/></request-map> <request-map uri="WebtoolsLayoutDemoText"><security https="true" auth="true"/><response name="success" type="view" value="WebtoolsLayoutDemoText"/></request-map> <request-map uri="WebtoolsLayoutDemoXml"><security https="true" auth="true"/><response name="success" type="view" value="WebtoolsLayoutDemoXml"/></request-map> + <request-map uri="WebtoolsLayoutDemoXls"><security https="true" auth="true"/><response name="success" type="view" value="WebtoolsLayoutDemoXls"/></request-map> <request-map uri="WebtoolsLayoutDemoCsv"><security https="true" auth="true"/><response name="success" type="view" value="WebtoolsLayoutDemoCsv"/></request-map> + <request-map uri="WebtoolsLayoutDemoXls"><security https="true" auth="true"/><response name="success" type="view" value="WebtoolsLayoutDemoXls"/></request-map> <!-- end of request mappings --> @@ -663,6 +665,7 @@ under the License. <view-map name="WebtoolsLayoutDemoText" page="component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemoText" type="screentext"/> <view-map name="WebtoolsLayoutDemoXml" page="component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemoText" content-type="text/xml" type="screenxml"/> <view-map name="WebtoolsLayoutDemoCsv" page="component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemoText" content-type="text/csv" type="screencsv"/> + <view-map name="WebtoolsLayoutDemoXls" page="component://webtools/widget/MiscScreens.xml#WebtoolsLayoutDemoText" content-type="application/vnd.ms-excel" type="screenxls"/> <!-- end of view mappings --> </site-conf> Modified: ofbiz/trunk/framework/webtools/widget/Menus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/Menus.xml?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/widget/Menus.xml (original) +++ ofbiz/trunk/framework/webtools/widget/Menus.xml Sun May 29 18:38:26 2016 @@ -353,6 +353,9 @@ under the License. <menu-item name="Csv" title="${uiLabelMap.CommonViewAsCsv}"> <link target="${demoTargetUrl}Csv" target-window="_blank"/> </menu-item> + <menu-item name="Xls" title="${uiLabelMap.CommonViewAsXls}"> + <link target="${demoTargetUrl}Xls" target-window="_blank"/> + </menu-item> </menu> </menus> Modified: ofbiz/trunk/framework/widget/config/widget.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/config/widget.properties?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/config/widget.properties (original) +++ ofbiz/trunk/framework/widget/config/widget.properties Sun May 29 18:38:26 2016 @@ -100,6 +100,14 @@ screenxml.treerenderer=component://widge screenxml.encoder=xml screenxml.default.contenttype=UTF-8 screenxml.default.encoding=none +# xls output +screenxls.name=xls +screenxls.screenrenderer=component://widget/templates/xlsScreenMacroLibrary.ftl +screenxls.formrenderer=component://widget/templates/xlsFormMacroLibrary.ftl +screenxls.treerenderer=component://widget/templates/xlsTreeMacroLibrary.ftl +screenxls.encoder=html +screenxls.default.contenttype=application/vnd.ms-excel +screenxls.default.encoding=none # fo output screenfop.name=xsl-fo screenfop.screenrenderer=component://widget/templates/FoScreenMacroLibrary.ftl Modified: ofbiz/trunk/framework/widget/dtd/widget-screen.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-screen.xsd?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/dtd/widget-screen.xsd (original) +++ ofbiz/trunk/framework/widget/dtd/widget-screen.xsd Sun May 29 18:38:26 2016 @@ -599,6 +599,13 @@ under the License. </xs:sequence> </xs:complexType> </xs:element> + <xs:element name="xls"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="HtmlWidgets" /> + </xs:sequence> + </xs:complexType> + </xs:element> <xs:element name="text"> <xs:complexType> <xs:sequence> Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelScreenWidget.java Sun May 29 18:38:26 2016 @@ -1298,6 +1298,8 @@ public abstract class ModelScreenWidget subWidgets.put("text", new HtmlWidget(modelScreen, childElement)); } else if ("csv".equals(childElement.getNodeName())) { subWidgets.put("csv", new HtmlWidget(modelScreen, childElement)); + } else if ("xls".equals(childElement.getNodeName())) { + subWidgets.put("xls", new HtmlWidget(modelScreen, childElement)); } else { throw new IllegalArgumentException("Tag not supported under the platform-specific tag with name: " + childElement.getNodeName()); } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/test/WidgetMacroLibraryTests.java Sun May 29 18:38:26 2016 @@ -101,6 +101,18 @@ public class WidgetMacroLibraryTests ext assertFalse("Csv Screen contains Macro on error : see " + screencsvUrl + " for more detail", screenOutString.contains("FreeMarker template error:")); } + public void testXlsMacroLibrary() throws Exception { + String screenxlsUrl = screenUrl.concat("Xls"); + HttpClient http = initHttpClient(); + http.setUrl(screenxlsUrl.concat(authentificationQuery)); + String screenOutString = http.post(); + assertNotNull("Response failed from ofbiz", screenOutString); + assertEquals("Response contentType isn't good : " + http.getResponseContentType(), "application/vnd.ms-excel;charset=UTF-8", http.getResponseContentType()); + + //Test if a ftl macro error is present + assertFalse("Csv Screen contains Macro on error : see " + screenxlsUrl + " for more detail", screenOutString.contains("FreeMarker template error:")); + } + public void testFopMacroLibrary() throws Exception { String screentextUrl = screenUrl.concat("Fop"); HttpClient http = initHttpClient(); Added: ofbiz/trunk/framework/widget/templates/xlsFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xlsFormMacroLibrary.ftl?rev=1746045&view=auto ============================================================================== --- ofbiz/trunk/framework/widget/templates/xlsFormMacroLibrary.ftl (added) +++ ofbiz/trunk/framework/widget/templates/xlsFormMacroLibrary.ftl Sun May 29 18:38:26 2016 @@ -0,0 +1,151 @@ +<#-- +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. +--> + +<#macro renderField text><#if text??>${text}</#if></#macro> + +<#macro renderItemField value cellType cellStyle=""><td class="${cellType!}" <#if cellStyle?has_content>${cellStyle!}</#if>>${value!}</td></#macro> + +<#macro renderDisplayField type imageLocation idName description title class alert inPlaceEditorUrl="" inPlaceEditorParams=""> +<#if type=="currency"><#assign value = StringUtil.makeStringWrapper(description!)><@renderItemField value "cf" class/> +<#elseif type=="date"><@renderItemField description "dt" class/> +<#elseif type=="date-time"><@renderItemField description "dtf" class/> +<#elseif type=="accounting-number"><@renderItemField description "nf" class/> +<#else><@renderItemField description "txf" class/></#if> +</#macro> +<#macro renderHyperlinkField></#macro> + +<#macro renderTextField name className alert value textSize maxlength id event action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex readonly placeholder=""><@renderItemField value "txf" className/></#macro> + +<#macro renderTextareaField name className alert cols rows maxlength id readonly value visualEditorEnable buttons tabindex language=""></#macro> + +<#macro renderDateTimeField name className alert title value size maxlength id dateType shortDateInput timeDropdownParamName defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected compositeType formName mask="" event="" action="" step="" timeValues="" tabindex="" > +<#if dateType=="time" ><@renderItemField value "tf" className/> +<#elseif dateType=="date"><@renderItemField value "dt" className/> +<#else><@renderItemField value "dtf" className/></#if> +</#macro> + +<#macro renderDropDownField name className alert id multiple formName otherFieldName event action size firstInList currentValue explicitDescription allowEmpty options fieldName otherFieldName otherValue otherFieldSize dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars choices autoSelect partialSearch partialChars ignoreCase fullSearch tabindex><@renderItemField explicitDescription "txf" className/></#macro> + +<#macro renderCheckField items className alert id allChecked currentValue name event action tabindex><@renderItemField currentValue "txf" className/></#macro> + +<#macro renderRadioField items className alert currentValue noCurrentSelectedKey name event action tabindex><@renderItemField currentValue "txf" className/></#macro> + +<#macro renderSubmitField buttonType className alert formName title name event action imgSrc confirmation containerId ajaxUrl tabindex></#macro> + +<#macro renderResetField className alert name title></#macro> + +<#macro renderHiddenField name value id event action></#macro> + +<#macro renderIgnoredField></#macro> + +<#macro renderFieldTitle style title id fieldHelpText="" for=""><@renderItemField title "txf" style/></#macro> + +<#macro renderSingleFormFieldTitle></#macro> + +<#macro renderFormOpen linkUrl formType targetWindow containerId containerStyle autocomplete name viewIndexField viewSizeField viewIndex viewSize useRowSubmit></#macro> +<#macro renderFormClose focusFieldName formName containerId hasRequiredField></#macro> +<#macro renderMultiFormClose></#macro> + +<#macro renderFormatListWrapperOpen formName style columnStyles><table></#macro> + +<#macro renderFormatListWrapperClose formName></table></#macro> + +<#macro renderFormatHeaderOpen><thead></#macro> +<#macro renderFormatHeaderClose></thead></#macro> + +<#macro renderFormatHeaderRowOpen style> +<tr> +</#macro> +<#macro renderFormatHeaderRowClose> +</tr> +</#macro> +<#macro renderFormatHeaderRowCellOpen style positionSpan></#macro> +<#macro renderFormatHeaderRowCellClose></#macro> + +<#macro renderFormatHeaderRowFormCellOpen style></#macro> +<#macro renderFormatHeaderRowFormCellClose></#macro> +<#macro renderFormatHeaderRowFormCellTitleSeparator style isLast></#macro> + +<#macro renderFormatItemRowOpen formName itemIndex altRowStyles evenRowStyle oddRowStyle> +<tr> +</#macro> +<#macro renderFormatItemRowClose formName> +</tr> +</#macro> +<#macro renderFormatItemRowCellOpen fieldName style positionSpan></#macro> +<#macro renderFormatItemRowCellClose fieldName></#macro> +<#macro renderFormatItemRowFormCellOpen style></#macro> +<#macro renderFormatItemRowFormCellClose></#macro> + +<#macro renderFormatSingleWrapperOpen formName style><table></#macro> +<#macro renderFormatSingleWrapperClose formName></table></#macro> + +<#macro renderFormatFieldRowOpen> +<tr> +</#macro> +<#macro renderFormatFieldRowClose> +</tr> +</#macro> +<#macro renderFormatFieldRowTitleCellOpen style></#macro> +<#macro renderFormatFieldRowTitleCellClose></#macro> +<#macro renderFormatFieldRowSpacerCell></#macro> +<#macro renderFormatFieldRowWidgetCellOpen positionSpan style> +</#macro> +<#macro renderFormatFieldRowWidgetCellClose> +</#macro> + +<#macro renderFormatEmptySpace><@renderItemField "" "txf"/></#macro> + +<#macro renderTextFindField name value defaultOption opEquals opBeginsWith opContains opIsEmpty opNotEqual className alert size maxlength autocomplete titleStyle hideIgnoreCase ignCase ignoreCase tabindex></#macro> + +<#macro renderDateFindField className alert name localizedInputTitle value value2 size maxlength dateType formName defaultDateTimeString imgSrc localizedIconTitle titleStyle defaultOptionFrom defaultOptionThru opEquals opSameDay opGreaterThanFromDayStart opGreaterThan opGreaterThan opLessThan opUpToDay opUpThruDay opIsEmpty tabindex></#macro> + +<#macro renderRangeFindField className alert name value size maxlength autocomplete titleStyle defaultOptionFrom opEquals opGreaterThan opGreaterThanEquals opLessThan opLessThanEquals value2 defaultOptionThru tabindex></#macro> + +<#macro renderLookupField name formName fieldFormName className="" alert="false" value="" size="" maxlength="" id="" event="" action="" readonly=false autocomplete="" descriptionFieldName="" targetParameterIter="" imgSrc="" ajaxUrl="" ajaxEnabled=javaScriptEnabled presentation="layer" width="" height="" position="" fadeBackground="true" clearText="" showDescription="" initiallyCollapsed="" lastViewName="main" tabindex=""><@renderItemField value "txf" className/></#macro> + +<#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel paginateViewSizeLabel></#macro> + +<#macro renderFileField className alert name value size maxlength autocomplete tabindex></#macro> +<#macro renderPasswordField className alert name value size maxlength id autocomplete tabindex></#macro> +<#macro renderImageField value description alternate style event action></#macro> + +<#macro renderBanner style leftStyle rightStyle leftText text rightText></#macro> + +<#macro renderContainerField id className></#macro> + +<#macro renderFieldGroupOpen style id title collapsed collapsibleAreaId collapsible expandToolTip collapseToolTip></#macro> + +<#macro renderFieldGroupClose style id title></#macro> + +<#macro renderHyperlinkTitle name title showSelectAll="N"></#macro> + +<#macro renderSortField style title linkUrl ajaxEnabled tooltip=""><td>${title!}</td></#macro> + +<#macro formatBoundaryComment boundaryType widgetType widgetName></#macro> + +<#macro renderTooltip tooltip tooltipStyle></#macro> + +<#macro renderClass className="" alert=""></#macro> + +<#macro renderAsterisks requiredField requiredStyle></#macro> + +<#macro makeHiddenFormLinkForm actionUrl name parameters targetWindow></#macro> +<#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description confirmation><td>${description!}</td></#macro> +<#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title targetParameters alternate linkUrl targetWindow description confirmation uniqueItemName="" height="" width="" id=""></#macro> Propchange: ofbiz/trunk/framework/widget/templates/xlsFormMacroLibrary.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/widget/templates/xlsFormMacroLibrary.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/widget/templates/xlsFormMacroLibrary.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/widget/templates/xlsScreenMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xlsScreenMacroLibrary.ftl?rev=1746045&view=auto ============================================================================== --- ofbiz/trunk/framework/widget/templates/xlsScreenMacroLibrary.ftl (added) +++ ofbiz/trunk/framework/widget/templates/xlsScreenMacroLibrary.ftl Sun May 29 18:38:26 2016 @@ -0,0 +1,52 @@ +<#-- +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. +--> + +<#macro renderScreenBegin></#macro> + +<#macro renderScreenEnd></#macro> + +<#macro renderSectionBegin boundaryComment></#macro> + +<#macro renderSectionEnd boundaryComment></#macro> + +<#macro renderContainerBegin id style autoUpdateLink autoUpdateInterval></#macro> +<#macro renderContainerEnd></#macro> +<#macro renderContentBegin editRequest enableEditValue editContainerStyle></#macro> +<#macro renderContentBody></#macro> +<#macro renderContentEnd urlString editMode editContainerStyle editRequest enableEditValue></#macro> +<#macro renderSubContentBegin editContainerStyle editRequest enableEditValue></#macro> +<#macro renderSubContentBody></#macro> +<#macro renderSubContentEnd urlString editMode editContainerStyle editRequest enableEditValue></#macro> + +<#macro renderHorizontalSeparator id style></#macro> +<#macro renderLabel text id style></#macro> +<#macro renderLink parameterList targetWindow target uniqueItemName linkType actionUrl id style name height width linkUrl text imgStr></#macro> +<#macro renderImage src id style wid hgt border alt urlString></#macro> + +<#macro renderContentFrame fullUrl width height border></#macro> +<#macro renderScreenletBegin id title collapsible saveCollapsed collapsibleAreaId expandToolTip collapseToolTip fullUrlString padded menuString showMore collapsed javaScriptEnabled></#macro> +<#macro renderScreenletSubWidget></#macro> +<#macro renderScreenletEnd></#macro> + +<#macro renderScreenletPaginateMenu lowIndex actualPageSize ofLabel listSize paginateLastStyle lastLinkUrl paginateLastLabel paginateNextStyle nextLinkUrl paginateNextLabel paginatePreviousStyle paginatePreviousLabel previousLinkUrl paginateFirstStyle paginateFirstLabel firstLinkUrl></#macro> + +<#macro renderColumnContainerBegin id style></#macro> +<#macro renderColumnContainerEnd></#macro> +<#macro renderColumnBegin id style></#macro> +<#macro renderColumnEnd></#macro> Propchange: ofbiz/trunk/framework/widget/templates/xlsScreenMacroLibrary.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/widget/templates/xlsScreenMacroLibrary.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/widget/templates/xlsScreenMacroLibrary.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/widget/templates/xlsTreeMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xlsTreeMacroLibrary.ftl?rev=1746045&view=auto ============================================================================== --- ofbiz/trunk/framework/widget/templates/xlsTreeMacroLibrary.ftl (added) +++ ofbiz/trunk/framework/widget/templates/xlsTreeMacroLibrary.ftl Sun May 29 18:38:26 2016 @@ -0,0 +1,33 @@ +<#-- +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. +--> + +<#macro renderNodeBegin style></#macro> + +<#macro renderLastElement style></#macro> + +<#macro renderNodeEnd processChildren isRootNode></#macro> + +<#macro renderLabel id style labelText></#macro> + +<#macro formatBoundaryComment boundaryType widgetType widgetName></#macro> + +<#macro renderLink id style name title targetWindow linkUrl linkText imgStr></#macro> + +<#macro renderImage src id style wid hgt border alt urlString></#macro> + \ No newline at end of file Propchange: ofbiz/trunk/framework/widget/templates/xlsTreeMacroLibrary.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/widget/templates/xlsTreeMacroLibrary.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/widget/templates/xlsTreeMacroLibrary.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/specialpurpose/example/webapp/example/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/webapp/example/WEB-INF/controller.xml?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/example/webapp/example/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/example/webapp/example/WEB-INF/controller.xml Sun May 29 18:38:26 2016 @@ -49,7 +49,9 @@ under the License. <request-map uri="EditExample"><security https="true" auth="true"/><response name="success" type="view" value="EditExample"/></request-map> <request-map uri="EditExampleLayer"><security https="true" auth="true"/><response name="success" type="view" value="EditExampleLayer"/></request-map> <request-map uri="ExampleReportHtml"><security https="true" auth="true"/><response name="success" type="view" value="ExampleReportHtml"/></request-map> + <request-map uri="ExampleReportXls"><security https="true" auth="true"/><response name="success" type="view" value="ExampleReportXls"/></request-map> <request-map uri="ExampleReportPdf"><security https="true" auth="true"/><response name="success" type="view" value="ExampleReportPdf"/></request-map> + <request-map uri="ListExampleExport"><security https="true" auth="true"/><response name="success" type="view" value="ListExampleExport"/></request-map> <request-map uri="createExample"> <security https="true" auth="true"/> <event type="service" invoke="createExample"/> @@ -248,7 +250,9 @@ under the License. <view-map name="EditExampleLayer" type="screen" page="component://example/widget/example/ExampleScreens.xml#EditExampleLayer"/> <view-map name="EditExampleItems" type="screen" page="component://example/widget/example/ExampleScreens.xml#EditExampleItems"/> <view-map name="EditExampleFeatureAppls" type="screen" page="component://example/widget/example/ExampleScreens.xml#EditExampleFeatureAppls"/> + <view-map name="ListExampleExport" type="screenxls" page="component://example/widget/example/ExampleScreens.xml#ListExampleExport" content-type="application/vnd.ms-excel"/> <view-map name="ExampleReportHtml" type="screen" page="component://example/widget/example/ExampleScreens.xml#ExampleReport"/> + <view-map name="ExampleReportXls" type="screenxls" page="component://example/widget/example/ExampleScreens.xml#ExampleReport"/> <view-map name="ExampleReportPdf" type="screenfop" page="component://example/widget/example/ExampleScreens.xml#ExampleReport" content-type="application/pdf" encoding="none"/> <view-map name="ExampleReportPdfBarcode" type="screenfop" page="component://example/widget/example/ExampleScreens.xml#ExampleReportPdfBarcode" content-type="application/pdf" encoding="none"/> Modified: ofbiz/trunk/specialpurpose/example/widget/example/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/CommonScreens.xml?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/example/widget/example/CommonScreens.xml (original) +++ ofbiz/trunk/specialpurpose/example/widget/example/CommonScreens.xml Sun May 29 18:38:26 2016 @@ -98,6 +98,9 @@ under the License. <parameter param-name="exampleId"/> <image url-mode="raw" src="${iconsLocation}/printer.png"/> </link> + <link target="ExampleReportXls" text="${uiLabelMap.CommonViewAsXls}" style="buttontext"> + <parameter param-name="exampleId"/> + </link> <link target="ExampleReportPdf" text="${uiLabelMap.CommonPdf}" style="buttontext" target-window="_blank"> <parameter param-name="exampleId"/> <image url-mode="raw" src="${iconsLocation}/page_white_acrobat.png"/> @@ -265,6 +268,9 @@ under the License. <screen name="SimpleDecorator"> <section> + <actions> + <property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/> + </actions> <widgets> <include-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml"/> </widgets> Modified: ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml (original) +++ ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml Sun May 29 18:38:26 2016 @@ -44,7 +44,11 @@ under the License. <option key="status"/> </radio> </field> - <field name="searchButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button" image-location="/images/icons/magnifier.png"/></field> + <field name="searchButton"><submit/></field> + <field name="exportButton" position="2" widget-style="smallSubmit" title=" "> + <hyperlink also-hidden="false" target-type="plain" description="${uiLabelMap.CommonExport}" + target="javascript: document.FindExamples.action='ListExampleExport'; document.FindExamples.submit();"/> + </field> </form> <form name="ListExamples" type="list" list-name="listIt" paginate-target="FindExample" default-entity-name="Example" separate-columns="true" @@ -126,6 +130,11 @@ under the License. <field name="exampleId"><ignored/></field> </grid> + <form name="ListExampleExport" type="list" extends="ListExamples" extends-resource="component://example/widget/example/ExampleForms.xml" paginate="false"> + <actions> + <call-parent-actions/> + </actions> + </form> <!-- Typically, this extended form wouldn't be necessary. The parent form (ListExamples) would have these attributes. For the Ajax example we want all example entities listed, so the we use the entity-condition Modified: ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml?rev=1746045&r1=1746044&r2=1746045&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml (original) +++ ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml Sun May 29 18:38:26 2016 @@ -64,6 +64,31 @@ under the License. </section> </screen> + <screen name="ListExampleExport"> + <section> + <widgets> + <decorator-screen name="SimpleDecorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <condition> + <if-has-permission permission="EXAMPLE" action="_VIEW"/> + </condition> + <actions> + <set field="exampleCtx" from-field="parameters"/> + </actions> + <widgets> + <include-form name="ListExampleExport" location="component://example/widget/example/ExampleForms.xml"/> + </widgets> + <fail-widgets> + <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label> + </fail-widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="EditExampleLayer"> <section> <actions> |
Free forum by Nabble | Edit this page |