svn commit: r1770621 [1/5] - in /ofbiz/trunk/specialpurpose/pricat: ./ config/ data/ entitydef/ groovyScripts/ groovyScripts/pricat/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/ofbiz/ src/main/jav...

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

svn commit: r1770621 [1/5] - in /ofbiz/trunk/specialpurpose/pricat: ./ config/ data/ entitydef/ groovyScripts/ groovyScripts/pricat/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/ofbiz/ src/main/jav...

shijh
Author: shijh
Date: Mon Nov 21 08:07:57 2016
New Revision: 1770621

URL: http://svn.apache.org/viewvc?rev=1770621&view=rev
Log:
OFBIZ-9123 Add a PriCat component under specialpurpose

Added:
    ofbiz/trunk/specialpurpose/pricat/
    ofbiz/trunk/specialpurpose/pricat/build.gradle
    ofbiz/trunk/specialpurpose/pricat/config/
    ofbiz/trunk/specialpurpose/pricat/config/PricatUiLabels.xml
    ofbiz/trunk/specialpurpose/pricat/config/pricat.properties
    ofbiz/trunk/specialpurpose/pricat/data/
    ofbiz/trunk/specialpurpose/pricat/data/PricatData.xml
    ofbiz/trunk/specialpurpose/pricat/entitydef/
    ofbiz/trunk/specialpurpose/pricat/entitydef/entitymodel.xml
    ofbiz/trunk/specialpurpose/pricat/groovyScripts/
    ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/
    ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImport.groovy
    ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy
    ofbiz/trunk/specialpurpose/pricat/ofbiz-component.xml
    ofbiz/trunk/specialpurpose/pricat/src/
    ofbiz/trunk/specialpurpose/pricat/src/main/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReport.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/InterfaceReport.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/InterfaceReportThread.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlReport.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/sample/SampleHtmlThread.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/util/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/util/ReportEncoder.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/util/ReportStringUtil.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/InterfacePricatParser.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlReport.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatEvents.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/poi/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/poi/xssf/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/poi/xssf/usermodel/
    ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/poi/xssf/usermodel/OFBizPricatUtil.java
    ofbiz/trunk/specialpurpose/pricat/webapp/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/WEB-INF/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/WEB-INF/web.xml
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/error/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/error/error.jsp
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/ftl/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/ftl/ExcelImportHistoryReport.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/ftl/pricatreport.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/ftl/report.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportHistory.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/ftl/viewExcelImportLog.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/includes/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/includes/pricat.css
    ofbiz/trunk/specialpurpose/pricat/webapp/pricat/index.jsp
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/WEB-INF/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/WEB-INF/web.xml
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/downloads/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/downloads/SamplePricatTemplate_V1.1.xlsx   (with props)
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/error/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/error/error.jsp
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/ftl/
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/ftl/SamplePricat.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/ftl/countdownreport.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/ftl/countupreport.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/ftl/main.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/ftl/parsePricatExcel.ftl
    ofbiz/trunk/specialpurpose/pricat/webapp/pricatdemo/index.jsp
    ofbiz/trunk/specialpurpose/pricat/widget/
    ofbiz/trunk/specialpurpose/pricat/widget/CommonScreens.xml
    ofbiz/trunk/specialpurpose/pricat/widget/PriCatDemoMenus.xml
    ofbiz/trunk/specialpurpose/pricat/widget/PriCatMenus.xml
    ofbiz/trunk/specialpurpose/pricat/widget/SampleScreens.xml

Added: ofbiz/trunk/specialpurpose/pricat/build.gradle
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/build.gradle?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/build.gradle (added)
+++ ofbiz/trunk/specialpurpose/pricat/build.gradle Mon Nov 21 08:07:57 2016
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+dependencies {
+    pluginLibsCompile 'org.safehaus.jug:jug:2.0.0:asl'
+    pluginLibsCompile 'org.apache.poi:poi-ooxml:3.14'
+    pluginLibsCompile 'org.apache.poi:poi-ooxml-schemas:3.14'
+    pluginLibsCompile 'org.apache.poi:poi-excelant:3.14'
+    pluginLibsCompile 'org.apache.poi:poi-scratchpad:3.14'
+}
\ No newline at end of file

Added: ofbiz/trunk/specialpurpose/pricat/config/PricatUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/config/PricatUiLabels.xml?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/config/PricatUiLabels.xml (added)
+++ ofbiz/trunk/specialpurpose/pricat/config/PricatUiLabels.xml Mon Nov 21 08:07:57 2016
@@ -0,0 +1,532 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <property key="PriCatCompanyName">
+        <value xml:lang="en">OFBiz: PriCat Demo</value>
+        <value xml:lang="zh">OFBiz:价目表</value>
+    </property>
+    <property key="PriCatApplication">
+        <value xml:lang="en">PriCat</value>
+        <value xml:lang="zh">价目表</value>
+    </property>
+    <property key="PriCatDemoCompanyName">
+        <value xml:lang="en">OFBiz: PriCat Demo</value>
+        <value xml:lang="zh">OFBiz:价目表演示</value>
+    </property>
+    <property key="PriCatDemoApplication">
+        <value xml:lang="en">PriCat Demo</value>
+        <value xml:lang="zh">价目表演示</value>
+    </property>
+    <property key="PriCatDemoCountDown">
+        <value xml:lang="en">HTML Report Demo - Count Down</value>
+        <value xml:lang="zh">页面输出演示 - 倒计数</value>
+    </property>
+    <property key="PriCatDemoCountUp">
+        <value xml:lang="en">HTML Report Demo - Count Up</value>
+        <value xml:lang="zh">页面输出演示 - 正计数</value>
+    </property>
+    <property key="PriCatDemoParseSamplePricat">
+        <value xml:lang="en">PriCat Demo - Parse PriCat</value>
+        <value xml:lang="zh">价目表演示 - 解析价目表</value>
+    </property>
+    <property key="PriCatDemoMainPage">
+        <value xml:lang="en">PriCat Demo Main Page</value>
+        <value xml:lang="zh">价目表演示首页</value>
+    </property>
+    <property key="PricatDemoMessage">
+        <value xml:lang="en">PriCat Demo includes 2 HTML Report Demo and 1 Parse PriCat File Demo.</value>
+        <value xml:lang="zh">价目表演示包含了2个页面输出演示和1个解析价目表文件的演示。</value>
+    </property>
+    <property key="ParseSamplePricatDemo">
+        <value xml:lang="en">Parse Sample PriCat Demo</value>
+        <value xml:lang="zh">演示解析样例价目表文件</value>
+    </property>
+    <property key="SamplePricatTemplate">
+        <value xml:lang="en">Sample PriCat Template</value>
+        <value xml:lang="zh">价目表样例模板</value>
+    </property>
+    <property key="DownloadPricatTemplate">
+        <value xml:lang="en">Download PriCat Template</value>
+        <value xml:lang="zh">下载价目表模板</value>
+    </property>
+    <property key="UploadPricat">
+        <value xml:lang="en">Upload PriCat</value>
+        <value xml:lang="zh">上传价目表</value>
+    </property>
+    <property key="ParseSamplePricat">
+        <value xml:lang="en">Parse Sample PriCat</value>
+        <value xml:lang="zh">解析样例价目表</value>
+    </property>
+    <property key="ExcelTemplateType">
+        <value xml:lang="en">Template Type</value>
+        <value xml:lang="zh">模板类型</value>
+    </property>
+    <property key="SamplePricatType">
+        <value xml:lang="en">Sample PriCat</value>
+        <value xml:lang="zh">样例价目表</value>
+    </property>
+    <property key="OFBizPricatType">
+        <value xml:lang="en">OFBiz Type</value>
+        <value xml:lang="zh">OFBiz类型</value>
+    </property>
+    <property key="StartStoreExcel">
+        <value xml:lang="en">Storing your upload file to server ... </value>
+        <value xml:lang="zh">正在把上传文件存到服务器中 ... </value>
+    </property>
+    <property key="NoFileUploaded">
+        <value xml:lang="en">no file uploaded!</value>
+        <value xml:lang="zh">没有上传文件!</value>
+    </property>
+    <property key="StartParsePricat">
+        <value xml:lang="en">Start parsing the uploaded file ...</value>
+        <value xml:lang="zh">开始解析上传的文件 ...</value>
+    </property>
+    <property key="PricatParseCompleted">
+        <value xml:lang="en">... parsing completed</value>
+        <value xml:lang="zh">... 完成解析</value>
+    </property>
+    <property key="CurrentUserLoginNoFacility">
+        <value xml:lang="en">Cannot find any facility for current user(userLoginId: [{0}]).</value>
+        <value xml:lang="zh">没有找到当前用户(userLoginId: [{0}])的任何一个仓库。</value>
+    </property>
+    <property key="GetCurrentUserLoginFacility">
+        <value xml:lang="en">Getting facilities of current user ... </value>
+        <value xml:lang="zh">正在获得当前用户的仓库 ... </value>
+    </property>
+    <property key="FacilityFoundForCurrentUserLogin">
+        <value xml:lang="en">({0}) Facility found for current user: {1}[{2}].</value>
+        <value xml:lang="zh">({0}) 找到当前用户的仓库:{1}[{2}]。</value>
+    </property>
+    <property key="FacilityNotBelongToYou">
+        <value xml:lang="en">Facility {0}[{1}] does not belong to you. Please use a facility of yours.</value>
+        <value xml:lang="zh">仓库{0}[{1}]不属于你,请改为你自己的仓库。</value>
+    </property>
+    <property key="ExcelTemplateTypeSelected">
+        <value xml:lang="en">The selected Excel template type: </value>
+        <value xml:lang="zh">选择的Excel模板类型:</value>
+    </property>
+    <property key="FacilityIdSelected">
+        <value xml:lang="en">The selected facility Id: </value>
+        <value xml:lang="zh">选择的仓库编号:</value>
+    </property>
+    <property key="ParsePricatFileStatement">
+        <value xml:lang="en">Loading file {0} ... </value>
+        <value xml:lang="zh">正在读入文件{0} ... </value>
+    </property>
+    <property key="PricatSuggestion">
+        <value xml:lang="en">Please make sure your Excel file is in format of Microsoft Excel 2007 and later. And then try again.</value>
+        <value xml:lang="zh">请确认你的Excel文件格式是微软Office 2007或更新版本的,然后重试一下。</value>
+    </property>
+    <property key="CheckPricatHasSheet">
+        <value xml:lang="en">Checking whether your file contains at least a sheet ... </value>
+        <value xml:lang="zh">正在检查你的文件是否包含至少一个表单 ... </value>
+    </property>
+    <property key="PricatVersionNotSupport">
+        <value xml:lang="en">Pricat Version {0} is not supported.</value>
+        <value xml:lang="zh">还不能支持这个价格分类的版本{0}。</value>
+    </property>
+    <property key="PricatTableOnlyParse1stSheet">
+        <value xml:lang="en">Only the 1st sheet will be parsed.</value>
+        <value xml:lang="zh">只解析第一张表。</value>
+    </property>
+    <property key="PricatTableNoSheet">
+        <value xml:lang="en">There's no sheet in the PriCat file.</value>
+        <value xml:lang="zh">价格分类文件中没有表。</value>
+    </property>
+    <property key="PricatTableRows">
+        <value xml:lang="en">Sheet [{2}] has {0} rows of header and {1} rows of data.</value>
+        <value xml:lang="zh">表单[{2}]有{0}行表头和{1}行数据。</value>
+    </property>
+    <property key="PricatTableRow">
+        <value xml:lang="en">Sheet [{0}] has only 1 row of data.</value>
+        <value xml:lang="zh">表单[{0}]只有一行数据。</value>
+    </property>
+    <property key="ExcelTableNoRow">
+        <value xml:lang="en">There's no row in sheet [{0}].</value>
+        <value xml:lang="zh">表单[{0}]中没有数据。</value>
+    </property>
+    <property key="ExcelTableColumnNumberNotMatch">
+        <value xml:lang="en">The sheet has {0} columns, it's not the same as sample sheet's {1}.</value>
+        <value xml:lang="zh">表单有{0}列,与样例表单的{1}列不同。</value>
+    </property>
+    <property key="ExcelTableColumnNotMatch">
+        <value xml:lang="en">The column {0} has a name {1}, it's not identical to {2}.</value>
+        <value xml:lang="zh">列{0}的名字是{1},应是{2}。</value>
+    </property>
+    <property key="ExcelParsingRow">
+        <value xml:lang="en">({0}) parsing {1} ...</value>
+        <value xml:lang="zh">({0}) 正在解析 {1} ...</value>
+    </property>
+    <property key="StartCheckPricatVersion">
+        <value xml:lang="en">Check PriCat file's version ... </value>
+        <value xml:lang="zh">检查价格分类文件的版本 ... </value>
+    </property>
+    <property key="StartCheckCurrencyId">
+        <value xml:lang="en">Checking currencyId ... </value>
+        <value xml:lang="zh">正在检查币种 ... </value>
+    </property>
+    <property key="CurrencyIdRequired">
+        <value xml:lang="en">CurrencyId is required. Please set it at row 3 column 2.</value>
+        <value xml:lang="zh">必须设置货币。请设置在第三行、第二列。</value>
+    </property>
+    <property key="CurrencyIdIs">
+        <value xml:lang="en">CurrencyId is {0}</value>
+        <value xml:lang="zh">货币是{0}</value>
+    </property>
+    <property key="CurrencyIdNotFound">
+        <value xml:lang="en">CurrencyId {0} cannot be found in this system.</value>
+        <value xml:lang="zh">本系统中找不到货币{0}。</value>
+    </property>
+    <property key="CurrencyIdNotCurrency">
+        <value xml:lang="en">{0} is not a currency in this system.</value>
+        <value xml:lang="zh">{0}在这个系统里不是货币。</value>
+    </property>
+    <property key="HeaderContainsError">
+        <value xml:lang="en">There are errors in PriCat header. Please correct it and upload it again.</value>
+        <value xml:lang="zh">表头中有错误,请修改后重新上传。</value>
+    </property>
+    <property key="PricatNoDataRows">
+        <value xml:lang="en">There are no data in your PriCat file, no further operation is required.</value>
+        <value xml:lang="zh">你的价格分类文件中没有数据,不再做数据解析了。</value>
+    </property>
+    <property key="DataContainsError">
+        <value xml:lang="en">There are errors in data of your PriCat file. Please correct it and upload it again.</value>
+        <value xml:lang="zh">价格分类文件的数据中有错误,请修改后重新上传。</value>
+    </property>
+    <property key="CellTypeNotString">
+        <value xml:lang="en">The type of cell[{0}, {1}] is not String. The cell value will be changed to String type.</value>
+        <value xml:lang="zh">单元格[{0}, {1}]不是字符类型。将把这个单元格的值转为字符类型。</value>
+    </property>
+    <property key="CellTypeNotNumeric">
+        <value xml:lang="en">The type of cell[{0}, {1}] is not numeric. The cell value will be changed to numeric type.</value>
+        <value xml:lang="zh">单元格[{0}, {1}]不是数字类型。将把这个单元格的值转为数字类型。</value>
+    </property>
+    <property key="ErrorParseValueToNumeric">
+        <value xml:lang="en">Unable to parse the value to a numeric.</value>
+        <value xml:lang="zh">无法把这个单元格的值转为数字。</value>
+    </property>
+    <property key="StartCheckHeaderColNum">
+        <value xml:lang="en">Checking whether the number of header columns matches the template's of version {0} ... </value>
+        <value xml:lang="zh">正在检查表头的列数是否与版本{0}的模板一致 ... </value>
+    </property>
+     <property key="HeaderColNumNotMatch">
+        <value xml:lang="en">The number of columns of {0} template header columns, column number {1} and imported template columns are not consistent ... </value>
+        <value xml:lang="zh">模板表头的列数{0}列,与导入的模板的列数{1}列不一致 ... </value>
+    </property>
+    <property key="StartCheckHeaderColLabel">
+        <value xml:lang="en">Checking whether the header labels match the template's of version {0} ... </value>
+        <value xml:lang="zh">正在检查表头的文字是否与版本{0}的模板一致 ... </value>
+    </property>
+    <property key="HeaderColLabelNotMatch">
+        <value xml:lang="en">The lable of row {0} colum {1} is [{2}], it does not match [{3}] as expected.</value>
+        <value xml:lang="zh">行{0}列{1}的文字是[{2}],与期望的[{3}]不一致。</value>
+    </property>
+ <property key="HeaderColNumShortThanRequired">
+        <value xml:lang="en">Table header column number less than the required {0}</value>
+        <value xml:lang="zh">表头列数小于要求的{0}列</value>
+    </property>
+ <property key="UseHeaderColNum">
+        <value xml:lang="en">the first {0} column labels will be checked</value>
+        <value xml:lang="zh">将检查表头的前{0}列的标签</value>
+    </property>
+    <property key="WriteCommentsBackToExcel">
+        <value xml:lang="en">Writing errors as commonts to your Excel file ... </value>
+        <value xml:lang="zh">正在把错误信息作为批注写到你的Excel文件里 ... </value>
+    </property>
+    <property key="CLEANUP_LOGANDEXCEL_BEGIN">
+        <value xml:lang="en">Start to clean log and commented excel files</value>
+        <value xml:lang="zh">开始清理日志和批注过的Excel文件</value>
+    </property>
+    <property key="HistoryLessThan">
+        <value xml:lang="en">history entries less than {0}</value>
+        <value xml:lang="zh">历史记录少于{0}条</value>
+    </property>
+    <property key="HistoryEntryToRemove">
+        <value xml:lang="en">{0} entries to remove</value>
+        <value xml:lang="zh">要删除{0}条记录</value>
+    </property>
+    <property key="FacilityNameNotMatchId">
+        <value xml:lang="en">In the system, the name of facilityId[{0}] is [{1}], NOT [{2}]. Please correct it and import again.</value>
+        <value xml:lang="zh">系统中,仓库标识[{0}]的名称是[{1}],不是[{2}]。请修改后重新导入。</value>
+    </property>
+    <property key="ExcelEmptyRow">
+        <value xml:lang="en">empty row</value>
+        <value xml:lang="zh">空行</value>
+    </property>
+
+    <property key="REPORT_EXCEPTION">
+        <value xml:lang="en">Exception: </value>
+        <value xml:lang="zh">意外错误:</value>
+    </property>
+    <property key="DIALOG_BUTTON_OK">
+        <value xml:lang="en">OK</value>
+        <value xml:lang="zh">确定</value>
+    </property>
+    <property key="DIALOG_BUTTON_CANCEL">
+        <value xml:lang="en">Cancel</value>
+        <value xml:lang="zh">取消</value>
+    </property>
+    <property key="DIALOG_BUTTON_EDIT">
+        <value xml:lang="en">Edit</value>
+        <value xml:lang="zh">编辑</value>
+    </property>
+    <property key="DIALOG_BUTTON_DISCARD">
+        <value xml:lang="en">Discard</value>
+        <value xml:lang="zh">放弃</value>
+    </property>
+    <property key="DIALOG_BUTTON_CLOSE">
+        <value xml:lang="en">Close</value>
+        <value xml:lang="zh">关闭</value>
+    </property>
+    <property key="DIALOG_BUTTON_ADVANCE">
+        <value xml:lang="en">Advance</value>
+        <value xml:lang="zh">高级</value>
+    </property>
+    <property key="DIALOG_BUTTON_SET">
+        <value xml:lang="en">Set</value>
+        <value xml:lang="zh">设置</value>
+    </property>
+    <property key="DIALOG_BUTTON_BACK">
+        <value xml:lang="en">Back</value>
+        <value xml:lang="zh">返回</value>
+    </property>
+    <property key="DIALOG_BUTTON_CONTINUE">
+        <value xml:lang="en">Continue</value>
+        <value xml:lang="zh">继续</value>
+    </property>
+    <property key="DIALOG_BUTTON_DETAIL">
+        <value xml:lang="en">Detail</value>
+        <value xml:lang="zh">详细</value>
+    </property>
+    <property key="DIALOG_BUTTON_DOWNLOAD">
+        <value xml:lang="en">Download</value>
+        <value xml:lang="zh">下载</value>
+    </property>
+    <property key="FORMAT_DEFAULT">
+        <value xml:lang="en">({0}) This is default format.</value>
+        <value xml:lang="zh">({0}) 这是缺省格式。</value>
+    </property>
+    <property key="FORMAT_WARNING">
+        <value xml:lang="en">({0}) This is warning format.</value>
+        <value xml:lang="zh">({0}) 这是警告格式。</value>
+    </property>
+    <property key="FORMAT_HEADLINE">
+        <value xml:lang="en">({0}) This is headline format.</value>
+        <value xml:lang="zh">({0}) 这是标题格式。</value>
+    </property>
+    <property key="FORMAT_NOTE">
+        <value xml:lang="en">({0}) This is note format.</value>
+        <value xml:lang="zh">({0}) 这是记录格式。</value>
+    </property>
+    <property key="FORMAT_OK">
+        <value xml:lang="en">({0}) This is OK format.</value>
+        <value xml:lang="zh">({0}) 这是正确时的格式。</value>
+    </property>
+    <property key="FORMAT_ERROR">
+        <value xml:lang="en">({0}) This is error format.</value>
+        <value xml:lang="zh">({0}) 这是错误时的格式。</value>
+    </property>
+    <property key="FORMAT_THROWABLE">
+        <value xml:lang="en">({0}) This is throwable format.</value>
+        <value xml:lang="zh">({0}) 这是抛出错误的格式。</value>
+    </property>
+    <property key="START_COUNT_DOWN">
+        <value xml:lang="en">Start counting down ...</value>
+        <value xml:lang="zh">开始倒数 ...</value>
+    </property>
+    <property key="COUNT_COMPLETED">
+        <value xml:lang="en">... counting completed.</value>
+        <value xml:lang="zh">... 完成计数。</value>
+    </property>
+    <property key="START_COUNT_UP">
+        <value xml:lang="en">String counting up ...</value>
+        <value xml:lang="zh">开始正计数 ...</value>
+    </property>
+    <property key="RPT_ERROR">
+        <value xml:lang="en">Error: </value>
+        <value xml:lang="zh">错误:</value>
+    </property>
+    <property key="RPT_ERROR_DETAILS">
+        <value xml:lang="en">Details: </value>
+        <value xml:lang="zh">详细:</value>
+    </property>
+    <property key="ParseExcelDemo">
+        <value xml:lang="en">Click here to see Import Excel demo</value>
+        <value xml:lang="zh">点击这里看导入Excel演示</value>
+    </property>
+    <property key="StartParseExcel">
+        <value xml:lang="en">Start parsing a sample excel file ...</value>
+        <value xml:lang="zh">开始解析一个Excel样例文件 ...</value>
+    </property>
+    <property key="ExcelParseCompleted">
+        <value xml:lang="en">... parsing completed</value>
+        <value xml:lang="zh">... 完成解析</value>
+    </property>
+    <property key="ExcelTableOnlyParse1stSheet">
+        <value xml:lang="en">Only the 1st sheet will be parsed.</value>
+        <value xml:lang="zh">只解析第一张表。</value>
+    </property>
+    <property key="ExcelTableNoSheet">
+        <value xml:lang="en">There's no sheet in the excel.</value>
+        <value xml:lang="zh">Excel中没有表。</value>
+    </property>
+    <property key="ExcelTableRows">
+        <value xml:lang="en">Sheet {1} has {0} rows.</value>
+        <value xml:lang="zh">表单{1}有{0}行数据。</value>
+    </property>
+    <property key="ExcelTableRow">
+        <value xml:lang="en">Sheet {0} has only 1 row.</value>
+        <value xml:lang="zh">表单{0}只有一行数据。</value>
+    </property>
+    <property key="ExcelTableNoRow">
+        <value xml:lang="en">There's no row in sheet {0}.</value>
+        <value xml:lang="zh">表单{0}中没有数据。</value>
+    </property>
+    <property key="ExcelTableColumnNumberNotMatch">
+        <value xml:lang="en">The sheet has {0} columns, it's not the same as sample sheet's {1}.</value>
+        <value xml:lang="zh">表单有{0}列,与样例表单的{1}列不同。</value>
+    </property>
+    <property key="ExcelTableColumnNotMatch">
+        <value xml:lang="en">The column {0} has a name {1}, it's not identical to {2}.</value>
+        <value xml:lang="zh">列{0}的名字是{1},应是{2}。</value>
+    </property>
+    <property key="ExcelParsingRow">
+        <value xml:lang="en">({0}) parsing {1} ...</value>
+        <value xml:lang="zh">({0}) 正在解析 {1} ...</value>
+    </property>
+    <property key="ParseExcelEncoding">
+        <value xml:lang="en">  Using {0} to parsing the excel file.</value>
+        <value xml:lang="zh">  æ­£åœ¨ä½¿ç”¨{0}解析Excel文件。</value>
+    </property>
+    <property key="ParseExcelToolStatement">
+        <value xml:lang="en">  Using {0} to parsing the {1} format excel file...</value>
+        <value xml:lang="zh">  æ­£åœ¨ä½¿ç”¨{0}解析{1}格式的Excel文件...</value>
+    </property>
+    <property key="ok">
+        <value xml:lang="en">ok</value>
+        <value xml:lang="zh">完成</value>
+    </property>
+    <property key="error">
+        <value xml:lang="en">error</value>
+        <value xml:lang="zh">出错了</value>
+    </property>
+    <property key="skipped">
+        <value xml:lang="en">skipped</value>
+        <value xml:lang="zh">跳过</value>
+    </property>
+
+ <property key="ExcelImportHistoryList">
+        <value xml:lang="en">Excel Import History</value>
+        <value xml:lang="zh">Excel导入操作历史记录</value>
+    </property>
+ <property key="OnlyYourOwnImportHistoryDisplayed">
+        <value xml:lang="en">(Only current login user's history can be displayed)</value>
+        <value xml:lang="zh">(仅能显示当前用户的导入操作历史记录)</value>
+    </property>
+ <property key="SerialNumber">
+        <value xml:lang="en">No.</value>
+        <value xml:lang="zh">序号</value>
+    </property>
+ <property key="Filename">
+        <value xml:lang="en">Filename</value>
+        <value xml:lang="zh">文件名</value>
+    </property>
+ <property key="FromDate">
+        <value xml:lang="en">Start Time</value>
+        <value xml:lang="zh">开始时间</value>
+    </property>
+ <property key="ThruDate">
+        <value xml:lang="en">End Time</value>
+        <value xml:lang="zh">结束时间</value>
+    </property>
+ <property key="ThruReasonId">
+        <value xml:lang="en">End Reason</value>
+        <value xml:lang="zh">结束原因</value>
+    </property>
+ <property key="ImportStatus">
+        <value xml:lang="en">Import Status</value>
+        <value xml:lang="zh">导入状态</value>
+    </property>
+ <property key="Actions">
+        <value xml:lang="en">Actions</value>
+        <value xml:lang="zh">操作</value>
+    </property>
+ <property key="ExcelImportTipNoData">
+        <value xml:lang="en">No excel import history data.</value>
+        <value xml:lang="zh">没有Excel导入历史记录</value>
+    </property>
+ <property key="EXCEL_IMPORTING">
+        <value xml:lang="en">Importing</value>
+        <value xml:lang="zh">正在导入</value>
+    </property>
+ <property key="EXCEL_IMPORTED">
+        <value xml:lang="en">Imported</value>
+        <value xml:lang="zh">已导入</value>
+    </property>
+ <property key="EXCEL_IMPORT_SUCCESS">
+        <value xml:lang="en">Success</value>
+        <value xml:lang="zh">成功</value>
+    </property>
+ <property key="EXCEL_IMPORT_STOPPED">
+        <value xml:lang="en">Stopped by user</value>
+        <value xml:lang="zh">用户终止了导入</value>
+    </property>
+ <property key="EXCEL_IMPORT_ERROR">
+        <value xml:lang="en">Stopped by error</value>
+        <value xml:lang="zh">因出错而停止了导入</value>
+    </property>
+ <property key="EXCEL_IMPORT_QUEST">
+        <value xml:lang="en">Data error found</value>
+        <value xml:lang="zh">数据中有错误</value>
+    </property>
+ <property key="ViewExcelImportLogContent">
+        <value xml:lang="en">View log content</value>
+        <value xml:lang="zh">浏览日志内容</value>
+    </property>
+ <property key="DownloadCommentedExcel">
+        <value xml:lang="en">Download excel</value>
+        <value xml:lang="zh">下载Excel</value>
+    </property>
+ <property key="ViewExcelImportHistory">
+        <value xml:lang="en">View Import History</value>
+        <value xml:lang="zh">导入操作历史记录</value>
+    </property>
+ <property key="ViewPricatLog">
+        <value xml:lang="en">View</value>
+        <value xml:lang="zh">浏览</value>
+    </property>
+ <property key="DownloadCommentedPricat">
+        <value xml:lang="en">Download</value>
+        <value xml:lang="zh">下载</value>
+    </property>
+
+ <property key="ReasonOK">
+        <value xml:lang="en">OK</value>
+    </property>
+ <property key="ReasonStopped">
+        <value xml:lang="en">[S]</value>
+    </property>
+ <property key="ReasonError">
+        <value xml:lang="en">[E]</value>
+    </property>
+ <property key="ReasonWarning">
+        <value xml:lang="en">[W]</value>
+    </property>
+</resource>

Added: ofbiz/trunk/specialpurpose/pricat/config/pricat.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/config/pricat.properties?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/config/pricat.properties (added)
+++ ofbiz/trunk/specialpurpose/pricat/config/pricat.properties Mon Nov 21 08:07:57 2016
@@ -0,0 +1,24 @@
+###############################################################################
+# 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.
+###############################################################################
+
+# the latest pricat version to parse and download
+pricat.latest.version=V1.1
+
+# the max number of pricat history files to keep
+pricat.history.max.filenumber=20

Added: ofbiz/trunk/specialpurpose/pricat/data/PricatData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/data/PricatData.xml?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/data/PricatData.xml (added)
+++ ofbiz/trunk/specialpurpose/pricat/data/PricatData.xml Mon Nov 21 08:07:57 2016
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<entity-engine-xml>
+ <!-- Enumeration for thruReasonId of ExcelImportHistory entity -->
+    <EnumerationType description="Excel import thru reasons" enumTypeId="EXCEL_IMPORT_THRU" hasTable="N" parentTypeId=""/>
+    
+    <Enumeration enumId="EXCEL_IMPORT_SUCCESS" enumCode="EXCEL_IMPORT_SUCCESS" description="Excel Imported Successfully" sequenceId="01" enumTypeId="EXCEL_IMPORT_THRU"/>
+    <Enumeration enumId="EXCEL_IMPORT_STOPPED" enumCode="EXCEL_IMPORT_STOPPED" description="Excel Imported Stopped by user" sequenceId="02" enumTypeId="EXCEL_IMPORT_THRU"/>
+    <Enumeration enumId="EXCEL_IMPORT_ERROR" enumCode="EXCEL_IMPORT_ERROR" description="Excel Imported Exits Errorly" sequenceId="03" enumTypeId="EXCEL_IMPORT_THRU"/>
+    <Enumeration enumId="EXCEL_IMPORT_QUEST" enumCode="EXCEL_IMPORT_QUEST" description="Excel Imported Has Error Messages" sequenceId="04" enumTypeId="EXCEL_IMPORT_THRU"/>
+
+ <!-- Enumeration for statusId of ExcelImportHistory entity -->
+    <EnumerationType description="Excel import status" enumTypeId="EXCEL_IMPORT_STATUS" hasTable="N" parentTypeId=""/>
+    
+    <Enumeration enumId="EXCEL_IMPORTING" enumCode="EXCEL_IMPORTING" description="Excel is being imported in progress" sequenceId="01" enumTypeId="EXCEL_IMPORT_STATUS"/>
+    <Enumeration enumId="EXCEL_IMPORTED" enumCode="EXCEL_IMPORTED" description="Excel has been imported" sequenceId="02" enumTypeId="EXCEL_IMPORT_STATUS"/>
+</entity-engine-xml>

Added: ofbiz/trunk/specialpurpose/pricat/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/entitydef/entitymodel.xml?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/entitydef/entitymodel.xml (added)
+++ ofbiz/trunk/specialpurpose/pricat/entitydef/entitymodel.xml Mon Nov 21 08:07:57 2016
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
+    
+    <entity entity-name="ExcelImportHistory"
+            package-name="org.ofbiz.product.catalog"
+            title="Excel Import History Entity">
+      <field name="userLoginId" type="id-vlong-ne"></field>
+      <field name="sequenceNum" type="numeric"></field>
+      <field name="fileName" type="value"></field>
+      <field name="fromDate" type="date-time"></field>
+      <field name="thruDate" type="date-time"></field>
+      <field name="thruReasonId" type="id-ne"></field>
+      <field name="statusId" type="id-ne"></field>
+      <field name="threadName" type="name"></field>
+      <field name="logFileName" type="value"></field>
+      <prim-key field="userLoginId"/>
+      <prim-key field="sequenceNum"/>
+      <relation rel-entity-name="UserLogin" type="one" fk-name="EXCELIMPORT_USERLOGIN">
+       <key-map field-name="userLoginId"/>
+      </relation>
+      <relation rel-entity-name="Enumeration" type="one" fk-name="EXCELIMPORT_STATUS">
+       <key-map field-name="statusId" rel-field-name="enumId"/>
+      </relation>
+      <relation rel-entity-name="Enumeration" type="one" fk-name="EXCELIMPORT_REASON">
+       <key-map field-name="thruReasonId" rel-field-name="enumId"/>
+      </relation>
+    </entity>
+    
+</entitymodel>

Added: ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImport.groovy?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImport.groovy (added)
+++ ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImport.groovy Mon Nov 21 08:07:57 2016
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+import org.apache.ofbiz.base.util.*;
+
+module = "FindMyExcelImport.groovy";
+
+data = delegator.findByAnd("ExcelImportHistory", [userLoginId : userLogin.userLoginId], ["sequenceNum DESC"], false);
+context.data = data;

Added: ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy (added)
+++ ofbiz/trunk/specialpurpose/pricat/groovyScripts/pricat/FindMyExcelImportLog.groovy Mon Nov 21 08:07:57 2016
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+import org.apache.ofbiz.base.util.*;
+import java.io.FileInputStream;
+
+module = "FindMyExcelImport.groovy";
+
+context.borderStyle = "2px inset /*begin-color ThreeDHighlight*/#ffffff/*end-color*/";
+context.borderSimpleStyle = "2px solid /*begin-color ThreeDFace*/#f0f0f0/*end-color*/";
+
+sequenceNum = request.getParameter("sequenceNum");
+
+if (sequenceNum == null) {
+ context.logFileContent = "No sequenceNum parameter found.";
+ return;
+}
+
+historyEntry = delegator.findOne("ExcelImportHistory", [sequenceNum : Long.valueOf(sequenceNum), userLoginId : userLogin.userLoginId], false);
+if (historyEntry == null) {
+ context.logFileContent = "No import history found.";
+ return;
+}
+
+logFile = FileUtil.getFile("runtime/pricat/" + userLogin.userLoginId + "/" + sequenceNum + ".log");
+if (!logFile.exists()) {
+ context.logFileContent = "No log file found.";
+}
+
+FileInputStream fis = new FileInputStream(logFile);
+InputStreamReader isr = new InputStreamReader(fis);
+BufferedReader br = new BufferedReader(isr);
+logFileContent = "";
+while((s = br.readLine())!=null){
+ logFileContent += s;
+}
+context.logFileContent = logFileContent;
+

Added: ofbiz/trunk/specialpurpose/pricat/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/ofbiz-component.xml?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/ofbiz-component.xml (added)
+++ ofbiz/trunk/specialpurpose/pricat/ofbiz-component.xml Mon Nov 21 08:07:57 2016
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<ofbiz-component name="pricat" enabled="true"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-component.xsd">
+    <resource-loader name="main" type="component"/>
+    <classpath type="dir" location="config"/>
+
+    <!-- entity resources: model(s), eca(s), group, and data definitions -->
+    <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
+    <entity-resource type="data" reader-name="seed" loader="main" location="data/PricatData.xml"/>
+
+    <webapp name="pricat"
+        title="PriCat"
+        server="default-server"
+        location="webapp/pricat"
+        app-bar-display="false"
+        base-permission="OFBTOOLS,CATALOG"
+        mount-point="/pricat" />
+
+    <webapp name="pricatdemo"
+        title="PriCat Demo"
+        server="default-server"
+        location="webapp/pricatdemo"
+        app-bar-display="false"
+        base-permission="OFBTOOLS,EXAMPLE"
+        mount-point="/pricatdemo" />
+</ofbiz-component>

Added: ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java (added)
+++ ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java Mon Nov 21 08:07:57 2016
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.apache.ofbiz.htmlreport;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.ofbiz.htmlreport.util.ReportStringUtil;
+
+/**
+ * HTML report output to be used for database create tables / drop tables operations.
+ *
+ */
+public abstract class AbstractHtmlReport extends HtmlReport {
+
+ public static final String module = AbstractHtmlReport.class.getName();
+
+ public final static String THREAD_TYPE = "thread_type";
+
+ public final static String RUN_CREATETABLE_SCRIPT = "runcreatetablescript";
+
+ public final static String RUN_DROPTABLE_SCRIPT = "rundroptablescript";
+
+ public final static String FILE_REPORT_OUTPUT = "specialpurpose/pricat/webapp/pricat/ftl/report.ftl";
+
+    /**
+     * Constructs a new report using the provided locale for the output language.
+     *
+     * @param request HttpServletRequest
+     * @param response HttpServletResponse
+     */
+    public AbstractHtmlReport(HttpServletRequest request, HttpServletResponse response) {
+        this(request, response, false, false);
+    }
+
+    /**
+     * Constructs a new report using the provided locale for the output language.
+     *  
+     * @param request HttpServletRequest
+     * @param response HttpServletResponse
+     * @param writeHtml if <code>true</code>, this report should generate HTML instead of JavaScript output
+     * @param isTransient If set to <code>true</code> nothing is kept in memory
+     */
+    public AbstractHtmlReport(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient) {
+        super(request, response, writeHtml, isTransient);
+    }
+    
+    /**
+     * Prepare display an html report.<p>
+     *
+     * @throws JspException if dialog actions fail
+     * @throws IOException
+     * @throws ServletException
+     * @throws TemplateException
+     * @throws IOException
+     */
+    public void prepareDisplayReport(HttpServletRequest request, HttpServletResponse response, String name, String dialogUri) throws IOException {
+
+     if (ReportStringUtil.isNotEmpty(dialogUri)) {
+     setDialogRealUri(request, dialogUri);
+     }
+        
+        String action = getParamAction(request);
+        if (action == null) action = "";
+        if (action.equals("reportend") || action.equals("cancel")) {
+            setParamAction("reportend");
+        } else if (action.equals("reportupdate")) {
+            setParamAction("reportupdate");
+        } else {
+            InterfaceReportThread thread = initializeThread(request, response, name);
+            thread.start();
+            setParamAction("reportbegin");
+            setParamThread(thread.getUUID().toString());
+        }
+    }
+
+    /**
+     * Initializes the report thread to use for this report.<p>
+     *
+     * @return the reported thread to use for this report.
+     */
+    public abstract InterfaceReportThread initializeThread(HttpServletRequest request, HttpServletResponse response, String name);
+
+    /**
+     * Set the report dialog uri.
+     *
+     * @param dialogUri
+     */
+    public void setDialogRealUri(HttpServletRequest request, String dialogUri) {
+     request.setAttribute(DIALOG_URI, dialogUri);
+    }
+
+    public static String checkButton(HttpServletRequest request, HttpServletResponse response) {
+     String action = request.getParameter("action");
+     if (ReportStringUtil.isNotEmpty(action)) {
+     if (action.equalsIgnoreCase("ok")) {
+     request.removeAttribute(SESSION_REPORT_CLASS);
+     request.removeAttribute(DIALOG_URI);
+     return "ok";
+     } else if (action.equalsIgnoreCase("cancel")) {
+     request.removeAttribute(SESSION_REPORT_CLASS);
+     request.removeAttribute(DIALOG_URI);
+     return "cancel";
+     }
+     }
+     action = request.getParameter("ok");
+     if (ReportStringUtil.isNotEmpty(action)) {
+     if (action.equalsIgnoreCase("ok")) {
+     request.removeAttribute(SESSION_REPORT_CLASS);
+     request.removeAttribute(DIALOG_URI);
+     return "ok";
+     }
+     }
+        action = request.getParameter("cancel");
+        if (ReportStringUtil.isNotEmpty(action)) {
+         if (action.equalsIgnoreCase("cancel")) {
+     request.removeAttribute(SESSION_REPORT_CLASS);
+     request.removeAttribute(DIALOG_URI);
+         return "cancel";
+         }
+        }
+        
+     return "success";
+    }
+}
\ No newline at end of file

Added: ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReport.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReport.java?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReport.java (added)
+++ ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReport.java Mon Nov 21 08:07:57 2016
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.apache.ofbiz.htmlreport;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Base report class.
+ *
+ */
+public abstract class AbstractReport implements InterfaceReport {
+
+    /** Contains all error messages generated by the report. */
+    private List<Object> errors;
+
+    /** The locale this report is written in. */
+    private Locale locale;
+
+    /** Runtime of the report. */
+    private long startTime;
+
+    /** Contains all warning messages generated by the report. */
+    private List<Object> warnings = new ArrayList<Object>();
+
+    /** Day constant. */
+    private static final long DAYS = 1000 * 60 * 60 * 24;
+
+    /** Hour constant. */
+    private static final long HOURS = 1000 * 60 * 60;
+
+    /** Minute constant. */
+    private static final long MINUTES = 1000 * 60;
+
+    /** Second constant. */
+    private static final long SECONDS = 1000;
+    
+    public static final String SESSION_REPORT_CLASS = "OFBIZ_HTML_REPORT";
+
+    public void addError(Object obj) {
+
+        errors.add(obj);
+    }
+
+    public void addWarning(Object obj) {
+
+        warnings.add(obj);
+    }
+
+    public String formatRuntime() {
+
+     long runtime = getRuntime();
+        long seconds = (runtime / SECONDS) % 60;
+        long minutes = (runtime / MINUTES) % 60;
+        long hours = (runtime / HOURS) % 24;
+        long days = runtime / DAYS;
+        StringBuffer strBuf = new StringBuffer();
+
+        if (days > 0) {
+            if (days < 10) {
+                strBuf.append('0');
+            }
+            strBuf.append(days);
+            strBuf.append(':');
+        }
+
+        if (hours < 10) {
+            strBuf.append('0');
+        }
+        strBuf.append(hours);
+        strBuf.append(':');
+
+        if (minutes < 10) {
+            strBuf.append('0');
+        }
+        strBuf.append(minutes);
+        strBuf.append(':');
+
+        if (seconds < 10) {
+            strBuf.append('0');
+        }
+        strBuf.append(seconds);
+
+        return strBuf.toString();
+    }
+
+    public List<Object> getErrors() {
+        return errors;
+    }
+
+    public Locale getLocale() {
+        return locale;
+    }
+
+    public long getRuntime() {
+        return System.currentTimeMillis() - startTime;
+    }
+
+    public List<Object> getWarnings() {
+        return warnings;
+    }
+
+    public boolean hasError() {
+        return (errors.size() > 0);
+    }
+    
+    public boolean hasWarning() {
+        return (warnings.size() > 0);
+    }
+
+    public void resetRuntime() {
+        startTime = System.currentTimeMillis();
+    }
+
+    /**
+     * Initializes some member variables for this report.<p>
+     *
+     * @param locale the locale for this report
+     */
+    protected void init(Locale locale) {
+        startTime = System.currentTimeMillis();
+        this.locale = locale;
+     errors = new ArrayList<Object>();
+    }
+
+    /**
+     * Prints a String to the report.<p>
+     *
+     * @param value the String to add
+     */
+    public void print(String value) {
+        print(value, FORMAT_DEFAULT);
+    }
+
+    /**
+     * Prints a String to the report, using the indicated formatting.<p>
+     *
+     * Use the contants starting with <code>FORMAT</code> from this interface
+     * to indicate which formatting to use.<p>
+     *
+     * @param value the message container to add
+     * @param format the formatting to use for the output
+     */
+    public abstract void print(String value, int format);
+
+    /**
+     * Prints a String with line break to the report.<p>
+     *
+     * @param value the message container to add
+     */
+    public void println(String value) {
+
+        println(value, FORMAT_DEFAULT);
+    }
+
+    /**
+     * Prints a String with line break to the report, using the indicated formatting.<p>
+     *
+     * Use the contants starting with <code>FORMAT</code> from this interface
+     * to indicate which formatting to use.<p>
+     *
+     * @param value the String to add
+     * @param format the formatting to use for the output
+     */
+    public void println(String value, int format) {
+        print(value, format);
+        println();
+    }
+
+}
\ No newline at end of file

Added: ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java?rev=1770621&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java (added)
+++ ofbiz/trunk/specialpurpose/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java Mon Nov 21 08:07:57 2016
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.apache.ofbiz.htmlreport;
+
+import java.util.List;
+import java.util.Locale;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.ofbiz.base.util.UtilHttp;
+import org.safehaus.uuid.EthernetAddress;
+import org.safehaus.uuid.UUID;
+import org.safehaus.uuid.UUIDGenerator;
+
+/**
+ * Provides a common Thread class for the reports.
+ *
+ */
+public abstract class AbstractReportThread extends Thread implements InterfaceReportThread {
+
+    /** Indicates if the thread was already checked by the grim reaper. */
+    private boolean doomed;
+    
+    /** The report that belongs to the thread. */
+    private InterfaceReport report;
+
+    /** The time this report is running. */
+    private long startTime;
+    
+    private UUID uuid;
+
+    private Locale locale;
+
+    /**
+     * Constructs a new report Thread with the given name.<p>
+     *
+     * @param name the name of the Thread
+     */
+    protected AbstractReportThread(HttpServletRequest request, HttpServletResponse response, String name) {
+
+        super(Thread.currentThread().getThreadGroup(), name);
+        // report Threads are never daemon Threads
+        setDaemon(false);
+        // the session must not be updated when it is used in a report
+        EthernetAddress ethernetAddress = UUIDGenerator.getInstance().getDummyAddress();
+        uuid = UUIDGenerator.getInstance().generateTimeBasedUUID(ethernetAddress);
+
+        setName(name + " [" + uuid.toString() + "]");
+        // new Threads are not doomed
+        doomed = false;
+        // set start time
+        startTime = System.currentTimeMillis();
+        locale = UtilHttp.getLocale(request);
+    }
+    
+    
+    public UUID getUUID() {
+     return uuid;
+    }
+
+    /**
+     * Adds an error object to the list of errors that occured during the report.<p>
+     *
+     * @param obj the error object
+     */
+    public void addError(Object obj) {
+
+        if (getReport() != null) {
+            getReport().addError(obj);
+        }
+    }
+
+    /**
+     * Returns the error exception in case there was an error during the execution of
+     * this Thread, null otherwise.<p>
+     *
+     * @return the error exception in case there was an error, null otherwise
+     */
+    public Throwable getError() {
+
+        return null;
+    }
+
+    /**
+     * Returns a list of all errors that occured during the report.<p>
+     *
+     * @return an error list that occured during the report
+     */
+    public List<?> getErrors() {
+
+        if (getReport() != null) {
+            return getReport().getErrors();
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Returns the part of the report that is ready for output.<p>
+     *
+     * @return the part of the report that is ready for output
+     */
+    public abstract String getReportUpdate();
+
+    /**
+     * Returns the time this report has been running.<p>
+     *
+     * @return the time this report has been running
+     */
+    public synchronized long getRuntime() {
+
+        if (doomed) {
+            return startTime;
+        } else {
+            return System.currentTimeMillis() - startTime;
+        }
+    }
+
+    /**
+     * Returns if the report generated an error output.<p>
+     *
+     * @return true if the report generated an error, otherwise false
+     */
+    public boolean hasError() {
+
+        if (getReport() != null) {
+            return (getReport().getErrors().size() > 0);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Returns true if this thread is already "doomed" to be deleted.<p>
+     *
+     * A OFBiz deamon Thread (the "Grim Reaper") will collect all
+     * doomed Threads, i.e. threads that are not longer active for some
+     * time.<p>
+     *
+     * @return true if this thread is already "doomed" to be deleted
+     */
+    public synchronized boolean isDoomed() {
+
+        if (isAlive()) {
+            // as long as the Thread is still active it is never doomed
+            return false;
+        }
+        if (doomed) {
+            // not longer active, and already doomed, so rest in peace...
+            return true;
+        }
+        // condemn the Thread to be collected by the grim reaper next time  
+        startTime = getRuntime();
+        doomed = true;
+        return false;
+    }
+
+    /**
+     * Returns the report where the output of this Thread is written to.<p>
+     *
+     * @return the report where the output of this Thread is written to
+     */
+    protected InterfaceReport getReport() {
+
+        return report;
+    }
+
+    /**
+     * Initialize a HTML report for this Thread.<p>
+     *
+     * @param locale the locale for the report output messages
+     */
+    protected void initHtmlReport(HttpServletRequest request, HttpServletResponse response) {
+
+        report = HtmlReport.getInstance(request, response);
+        ((HtmlReport) report).setParamThread(getUUID().toString());
+    }
+    
+    /**
+     * Initialize a HTML report for this Thread.<p>
+     *
+     * @param locale the locale for the report output messages
+     */
+    protected void initHtmlReport(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient) {
+
+        report = HtmlReport.getInstance(request, response, writeHtml, isTransient);
+        ((HtmlReport) report).setParamThread(getUUID().toString());
+    }
+    
+    protected void initHtmlReport(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient, String logFileName) {
+
+        report = HtmlReport.getInstance(request, response, writeHtml, isTransient, logFileName);
+        ((HtmlReport) report).setParamThread(getUUID().toString());
+    }
+    
+    protected Locale getLocale() {
+     return locale;
+    }
+
+}