Author: mthl
Date: Sun Sep 22 12:29:54 2019
New Revision: 1867342

URL: http://svn.apache.org/viewvc?rev=1867342&view=rev
Log:
Reverted: JSON entity data import and export utility
(OFBIZ-10966)

Implementation was not matching OFBiz code quality requirements.

Removed:
    
ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityJsonReader.java
    
ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/JsonDsDump.groovy
    
ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/EntityJsonEvents.java
    
ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/EntityJsonHelper.java
    
ofbiz/ofbiz-framework/trunk/framework/webtools/template/entity/EntityExportAllJson.ftl
    
ofbiz/ofbiz-framework/trunk/framework/webtools/template/entity/EntityImportDirJson.ftl
    
ofbiz/ofbiz-framework/trunk/framework/webtools/template/entity/EntityImportJson.ftl
    
ofbiz/ofbiz-framework/trunk/framework/webtools/template/entity/JsonDsDump.ftl
Modified:
    
ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml
    
ofbiz/ofbiz-framework/trunk/applications/commonext/widget/ofbizsetup/CommonScreens.xml
    ofbiz/ofbiz-framework/trunk/build.gradle
    ofbiz/ofbiz-framework/trunk/framework/webtools/config/WebtoolsUiLabels.xml
    ofbiz/ofbiz-framework/trunk/framework/webtools/servicedef/services.xml
    
ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
    ofbiz/ofbiz-framework/trunk/framework/webtools/template/Main.ftl
    
ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
    ofbiz/ofbiz-framework/trunk/framework/webtools/widget/EntityScreens.xml
    ofbiz/ofbiz-framework/trunk/framework/webtools/widget/Menus.xml

Modified: 
ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml
 Sun Sep 22 12:29:54 2019
@@ -58,17 +58,6 @@
         <response name="success" type="view" value="EntityExportAll"/>
         <response name="error" type="view" value="EntityExportAll"/>
     </request-map>
-    <request-map uri="EntityExportAllJson">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="EntityExportAllJson"/>
-        <response name="error" type="view" value="EntityExportAllJson"/>
-    </request-map>
-    <request-map uri="entityExportAllJson">
-        <security https="true" auth="true"/>
-        <event type="service" path="" invoke="entityExportAllJson"/>
-        <response name="success" type="view" value="EntityExportAllJson"/>
-        <response name="error" type="view" value="EntityExportAllJson"/>
-    </request-map>
     
     <!-- ================ Product Store Requests ============= -->
     <request-map uri="FindProductStore">
@@ -217,7 +206,6 @@
     <view-map name="EditProductStore" type="screen" 
page="component://commonext/widget/ofbizsetup/SetupScreens.xml#EditProductStore"/>
 
     <view-map name="EntityExportAll" type="screen" 
page="component://commonext/widget/ofbizsetup/CommonScreens.xml#EntityExportAll"/>
-    <view-map name="EntityExportAllJson" type="screen" 
page="component://commonext/widget/ofbizsetup/CommonScreens.xml#EntityExportAllJson"/>
 
     <view-map name="FindWebSite" type="screen" 
page="component://commonext/widget/ofbizsetup/SetupScreens.xml#FindWebSite"/>
     <view-map name="EditWebSite" type="screen" 
page="component://commonext/widget/ofbizsetup/SetupScreens.xml#EditWebSite"/>

Modified: 
ofbiz/ofbiz-framework/trunk/applications/commonext/widget/ofbizsetup/CommonScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/commonext/widget/ofbizsetup/CommonScreens.xml?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/commonext/widget/ofbizsetup/CommonScreens.xml
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/commonext/widget/ofbizsetup/CommonScreens.xml
 Sun Sep 22 12:29:54 2019
@@ -153,26 +153,4 @@
             </widgets>
         </section>
     </screen>
-    <screen name="EntityExportAllJson">
-        <section>
-            <actions>
-                <set field="titleProperty" 
value="PageTitleEntityExportAllJson"/>
-                <set field="tabButtonItem" value="entityExportAllJson"/>
-                <set field="parameters.TRANSACTION_TIMEOUT" value="7200"/>
-                <set field="results" from-field="parameters.results"/>
-                <set field="headerItem" value="export"/>
-            </actions>
-            <widgets>
-                <decorator-screen name="main-decorator" 
location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">
-                        <screenlet 
title="${uiLabelMap.PageTitleEntityExportAllJson}">
-                            <platform-specific>
-                                <html><html-template 
location="component://webtools/template/entity/EntityExportAllJson.ftl"/></html>
-                            </platform-specific>
-                        </screenlet>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-        </section>
-    </screen>
 </screens>

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Sun Sep 22 12:29:54 2019
@@ -202,7 +202,6 @@ dependencies {
     implementation 'wsdl4j:wsdl4j:1.6.3'
     implementation 'org.jsoup:jsoup:1.12.1'
     implementation 'com.auth0:java-jwt:3.8.2'
-    implementation 'org.json:json:20140107'
     testImplementation 'org.hamcrest:hamcrest:2.1'
     testImplementation 'org.hamcrest:hamcrest-library:2.1' // Enable junit4 to 
not depend on hamcrest-1.3
     testImplementation 'org.mockito:mockito-core:3.0.0'

Modified: 
ofbiz/ofbiz-framework/trunk/framework/webtools/config/WebtoolsUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/config/WebtoolsUiLabels.xml?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webtools/config/WebtoolsUiLabels.xml 
(original)
+++ ofbiz/ofbiz-framework/trunk/framework/webtools/config/WebtoolsUiLabels.xml 
Sun Sep 22 12:29:54 2019
@@ -98,15 +98,6 @@
         <value 
xml:lang="zh">没有指定的文件名/网址或完整的XML文档,什么也不做。</value>
         <value 
xml:lang="zh-TW">沒有指定的檔案名/網址或完整的XML檔,什麼也不做.</value>
     </property>
-    <property key="EntityImportNoJsonFileSpecified">
-        <value xml:lang="en">No filename/URL or complete JSON document 
specified, doing nothing.</value>
-        <value xml:lang="fr">Pas de fichier, URL ou flux JSON fournit, aucune 
action réalisée.</value>
-        <value xml:lang="it">Nessun nome file/URL o documento JSON completo 
specificato, nientre verrà fatto.</value>
-        <value xml:lang="ja">ファイル名/URLまたは完å…
¨ãªJSON文書が指定されていません。処理を行いません。</value>
-        <value xml:lang="vi">Không Tập tin/URL hoặc tài liệu JSON hoà
n chỉnh nào được xác định nên hệ thống sẽ không làm gì 
cả.</value>
-        <value 
xml:lang="zh">没有指定的文件名/网址或完整的JSON文档,什么也不做。</value>
-        <value 
xml:lang="zh-TW">沒有指定的檔案名/網址或完整的JSON檔,什麼也不做.</value>
-    </property>
     <property key="EntityImportNumberOfEntityToBeProcessed">
         <value xml:lang="en">Got ${numberRead} entities from 
${fileName}</value>
         <value xml:lang="fr">Chargement de ${numberRead} entités depuis 
${fileName}</value>
@@ -125,15 +116,6 @@
         <value 
xml:lang="zh">解析实体XML文件时出错:${errorString}</value>
         <value 
xml:lang="zh-TW">解析資料實體XML檔時出錯:${errorString}</value>
     </property>
-    <property key="EntityImportJsonParsingError">
-        <value xml:lang="en">ERROR parsing Entity Json file: 
${errorString}</value>
-        <value xml:lang="fr">ERREUR dans l'analyse de l'JSON : 
${errorString}</value>
-        <value xml:lang="it">ERRORE di parsing file entità JSON: 
${errorString}</value>
-        <value 
xml:lang="ja">エンティティJSONファイルパース時にエラー: 
${errorString}</value>
-        <value xml:lang="vi">LỖI khi phân tích tập tin JSON Thực 
thể: ${errorString}</value>
-        <value 
xml:lang="zh">解析实体JSON文件时出错:${errorString}</value>
-        <value 
xml:lang="zh-TW">解析資料實體JSON檔時出錯:${errorString}</value>
-    </property>
     <property key="EntityImportPassedFile">
         <value xml:lang="en">Pass ${passes} complete</value>
         <value xml:lang="fr">Passe ${passes} complete</value>
@@ -531,32 +513,6 @@
         <value xml:lang="zh">XML数据导出全部</value>
         <value xml:lang="zh-TW">XML資料匯出全部</value>
     </property>
-    <property key="PageTitleEntityExportJson">
-        <value xml:lang="de">JSON-Daten exportieren</value>
-        <value xml:lang="en">JSON Data Export</value>
-        <value xml:lang="fr">Export de données JSON</value>
-        <value xml:lang="it">Esporta dati in JSON</value>
-        <value xml:lang="ja">JSONデータエクスポート</value>
-        <value xml:lang="pt">Exportação de dados JSON</value>
-        <value xml:lang="ro">Exporta Date in JSON</value>
-        <value xml:lang="th">ส่งออกข้อมูล json</value>
-        <value xml:lang="vi">Kết xuất dữ liệu JSON</value>
-        <value xml:lang="zh">JSON数据导出</value>
-        <value xml:lang="zh-TW">JSON資料匯出</value>
-    </property>
-    <property key="PageTitleEntityExportAllJson">
-        <value xml:lang="de">Alle JSON-Daten exportieren</value>
-        <value xml:lang="en">JSON Data Export All</value>
-        <value xml:lang="fr">Exporter toutes les données JSON</value>
-        <value xml:lang="it">Esporta tutti i dati in JSON</value>
-        <value 
xml:lang="ja">JSONデータをすべてエクスポート</value>
-        <value xml:lang="pt">Exportação de todos os dados JSON</value>
-        <value xml:lang="ro">Exporta Toate Datele in JSON</value>
-        <value xml:lang="th">ส่งออกข้อมูล JSON 
ทั้งหมด</value>
-        <value xml:lang="vi">Kết xuất tất cả dữ liệu JSON</value>
-        <value xml:lang="zh">JSON数据导出全部</value>
-        <value xml:lang="zh-TW">JSON資料匯出全部</value>
-    </property>
     <property key="PageTitleEntityImport">
         <value xml:lang="de">XML-Daten importieren</value>
         <value xml:lang="en">XML Data Import</value>
@@ -583,32 +539,6 @@
         <value xml:lang="zh">XML数据导入目录 </value>
         <value xml:lang="zh-TW">XML資料匯入目錄 </value>
     </property>
-    <property key="PageTitleEntityImportJson">
-        <value xml:lang="de">JSON-Daten importieren</value>
-        <value xml:lang="en">JSON Data Import</value>
-        <value xml:lang="fr">Import de données JSON</value>
-        <value xml:lang="it">Importa dati da JSON</value>
-        <value xml:lang="ja">JSONデータインポート</value>
-        <value xml:lang="pt">Importar dados JSON</value>
-        <value xml:lang="ro">Importa Datele din JSON</value>
-        <value xml:lang="th">นำเข้าข้อมูล json</value>
-        <value xml:lang="vi">Nhập khẩu dữ liệu JSON</value>
-        <value xml:lang="zh">JSON数据导入</value>
-        <value xml:lang="zh-TW">JSON資料匯入</value>
-    </property>
-    <property key="PageTitleEntityImportDirJson">
-        <value xml:lang="de">JSON Datenimport aus Verzeichnis</value>
-        <value xml:lang="en">JSON Data Import Dir</value>
-        <value xml:lang="fr">Import de données JSON depuis un 
répertoire</value>
-        <value xml:lang="it">Importa dati JSON in directory</value>
-        <value 
xml:lang="ja">JSONデータインポートディレクトリ</value>
-        <value xml:lang="pt">Importar dados JSON em diretório</value>
-        <value xml:lang="ro">Importa Datele din JSON in Directory</value>
-        <value xml:lang="th">นำเข้าข้อมูล json ใน 
Directory</value>
-        <value xml:lang="vi">Thư mục nhập khẩu JSON</value>
-        <value xml:lang="zh">JSON数据导入目录 </value>
-        <value xml:lang="zh-TW">JSON資料匯入目錄 </value>
-    </property>
     <property key="PageTitleEntityImportReaders">
         <value xml:lang="de">Leser für XML Datenimport</value>
         <value xml:lang="en">XML Data Import Readers</value>
@@ -1290,19 +1220,6 @@
         <value xml:lang="zh">完成XML文档 (根标签: 
entity-engine-xml)</value>
         <value xml:lang="zh-TW">完成XML檔 (根標簽: 
entity-engine-xml)</value>
     </property>
-    <property key="WebtoolsCompleteJsonData">
-        <value xml:lang="de">Vollständiges JSON dokument</value>
-        <value xml:lang="en">Complete JSON data</value>
-        <value xml:lang="fr">Compléter le data JSON</value>
-        <value xml:lang="it">Documento JSON</value>
-        <value xml:lang="ja">JSONドキュメントを完了する</value>
-        <value xml:lang="pt">Documento JSON completo</value>
-        <value xml:lang="ro">Completeaza documentul JSON</value>
-        <value xml:lang="th">เอกสาร JSON 
เสร็จเรียบร้อยแล้ว</value>
-        <value xml:lang="vi">Hoàn thành tài liệu JSON</value>
-        <value xml:lang="zh">完成JSON文档</value>
-        <value xml:lang="zh-TW">完成JSON檔</value>
-    </property>
     <property key="WebtoolsComponentsLoaded">
         <value xml:lang="de">Komponenten geladen</value>
         <value xml:lang="en">Loaded Components</value>
@@ -2080,18 +1997,6 @@
         <value xml:lang="zh">实体XML工具</value>
         <value xml:lang="zh-TW">資料實體XML工具</value>
     </property>
-    <property key="WebtoolsEntityJSONTools">
-        <value xml:lang="de">Entität JSON Tools</value>
-        <value xml:lang="en">Entity JSON Tools</value>
-        <value xml:lang="fr">Outils JSON d'entité</value>
-        <value xml:lang="it">Strumenti JSON per entità</value>
-        <value xml:lang="ja">エンティティJSONツール</value>
-        <value xml:lang="ro">Instrumente pentru Entitatea JSON</value>
-        <value xml:lang="th">เครื่องมือ Entity JSON 
</value>
-        <value xml:lang="vi">Công cụ JSON Thực thể</value>
-        <value xml:lang="zh">实体JSON工具</value>
-        <value xml:lang="zh-TW">資料實體XML工具</value>
-    </property>
     <property key="WebtoolsEnvName">
         <value xml:lang="de">Umgebungsname</value>
         <value xml:lang="en">Env Name</value>
@@ -2281,19 +2186,6 @@
         <value xml:lang="zh">从数据源导出XML</value>
         <value xml:lang="zh-TW">從資料源匯出XML</value>
     </property>
-    <property key="WebtoolsExportJSONFromDataSource">
-        <value xml:lang="de">JSON Export aus der Datenquelle</value>
-        <value xml:lang="en">JSON Export from DataSource(s)</value>
-        <value xml:lang="fr">Export JSON depuis les sources de données</value>
-        <value xml:lang="it">Esportazione JSON da Datasource</value>
-        <value 
xml:lang="ja">データソースからJSONをエクスポート</value>
-        <value xml:lang="pt">Exportar de JSON DataSource(s)</value>
-        <value xml:lang="ro">Exporta Sursa Date in JSON</value>
-        <value xml:lang="th">JSON 
ที่มาจากแหล่งข้อมูล</value>
-        <value xml:lang="vi">Kết xuất JSON từ nguồn dữ liệu</value>
-        <value xml:lang="zh">从数据源导出JSON</value>
-        <value xml:lang="zh-TW">從資料源匯出JSON</value>
-    </property>
     <property key="WebtoolsExportable">
         <value xml:lang="de">Exportierbar</value>
         <value xml:lang="en">Exportable</value>
@@ -2748,19 +2640,6 @@
         <value xml:lang="zh">把XML导入到数据源</value>
         <value xml:lang="zh-TW">把XML匯入到資料源</value>
     </property>
-    <property key="WebtoolsJsonImportToDataSource">
-        <value xml:lang="de">JSON-Import in DataSource(n)</value>
-        <value xml:lang="en">JSON Import to DataSource(s)</value>
-        <value xml:lang="fr">Import JSON vers la source de données</value>
-        <value xml:lang="it">Importazione JSON in Datasource</value>
-        <value 
xml:lang="ja">データソースにJSONをインポート</value>
-        <value xml:lang="pt">Importar JSON para DataSource(s)</value>
-        <value xml:lang="ro">Importa Sursa de Date din JSON</value>
-        <value xml:lang="th">นำเข้า JSON 
ไปยังแหล่งข้อมูล</value>
-        <value xml:lang="vi">Nhập khẩu JSON từ nguồn dữ 
liệu</value>
-        <value xml:lang="zh">把JSON导入到数据源</value>
-        <value xml:lang="zh-TW">把JSON匯入到資料源</value>
-    </property>
     <property key="WebtoolsImportantLogLevel">
         <value xml:lang="de">Wichtig</value>
         <value xml:lang="en">Important</value>
@@ -6063,7 +5942,7 @@
     <property key="WebtoolsXMLExportInfo">
         <value xml:lang="de">Hier Seite können Daten aus der Datenbank 
exportiert werden. Die exportierten Dokumente werden in einem XML-root-tag 
"&lt;entity-engine-xml&gt;" enthalten sein. Es wird für jede Entität in dem 
für diese webapp konfigurierten Delegator eine eigene Datei erstellt.</value>
         <value xml:lang="en">This page can be used to export data from the 
database. The exported documents will have a root tag of 
"&lt;entity-engine-xml&gt;". There will be one file for each Entity in the 
configured delegator for this webapp.</value>
-        <value xml:lang="fr">Cette page peut être utilisée pour exporter des 
données depuis la base. Les documents exportés auront une balise de racine de 
"&lt;entity-engine-xml&gt;". Il y aura un fichier créé pour chaque entité 
dans le delegator configuré pour cette webapp.</value>
+        <value xml:lang="fr">Cette page peut être utilisée pour exporter des 
données depuis la base. Les documents exportés auront une balise de racine de 
"&lt;entity-engine-xml&gt;". Il y aura un dossier pour chaque entité dans le 
delegator configuré pour cette webapp.</value>
         <value xml:lang="it">Questa pagina può essere usata per esportare i 
dati dal database. I documenti esportati avranno un root tag 
"&lt;entity-engine-xml&gt;". C'è un file per ogni Entità nel delegator 
configurato per questa applicazione web.</value>
         <value 
xml:lang="ja">このページでデータベースからデータをエクスポートすることができます。エクスポートするドキュメントには"&lt;entity-engine-xml&gt;"ルートタグがあります。Webアプリケーションに設定されたデリゲータの中のそれぞれのエンティティに対して1つのファイルが作成されます。</value>
         <value xml:lang="pt">Esta página pode ser utilizado para exportar 
dados do banco de dados. Os documentos de exportação terão uma tag 
raiz de " &lt;entity-engine-xml&gt;". Haverá um arquivo para cada entidade 
do delegator configurado para essa webapp.</value>
@@ -6073,43 +5952,6 @@
         <value xml:lang="zh">本页面用于从数据库导出数据 
导出的文档会有一个"&lt;entity-engine-xml&gt;"的根æ 
‡ç­¾åœ¨ä¸ºè¿™ä¸ªåº”用é…
ç½®çš„代表中,会对每个实体有一个文件。</value>
         <value xml:lang="zh-TW">本頁面用於從資料庫匯出資料 
匯出的檔會有一個"&lt;entity-engine-xml&gt;"的æ 
¹æ¨™ç°½åœ¨ç‚ºé€™å€‹æ‡‰ç”¨é…
ç½®çš„代表中,會對每個資料實體有一個檔.&lt;/entity-engine-xml&gt;</value>
     </property>
-    <property key="WebtoolsWroteNRecordsToJSONFile">
-        <value xml:lang="de">Es wurden ${numberWritten} Datensätze in die 
Datei ${parameters.filename} geschrieben.</value>
-        <value xml:lang="en">Wrote ${numberWritten} records to JSON file 
${parameters.filename}.</value>
-        <value xml:lang="fr">Ecrire ${numberWritten} les enregistrements dans 
le fichier JSON ${parameters.filename}.</value>
-        <value xml:lang="it">Scritti ${numberWritten} records su file JSON 
${parameters.filename}.</value>
-        <value xml:lang="ja">${numberWritten} 
レコードを、JSONファイル ${parameters.filename} 
に書き出しました。</value>
-        <value xml:lang="pt">Escreveu  ${numberWritten} registros para o 
arquivo JSON ${parameters.filename}.</value>
-        <value xml:lang="th">เขียน ${numberWritten} 
บันทึกมูล XML ไฟล์ ${parameters.filename}.</value>
-        <value xml:lang="vi">Đã ghi ${numberWritten} bản ghi tới tập 
tin JSON ${parameters.filename}.</value>
-        <value 
xml:lang="zh">把${numberWritten}个记录写到JSON文件${parameters.filename}。</value>
-        <value 
xml:lang="zh-TW">把${numberWritten}個記錄寫到JSON檔${parameters.filename}.</value>
-    </property>
-    <property key="WebtoolsWroteJSONForAllDataIn">
-        <value xml:lang="de">Es wurde JSON für alle Daten in 
${numberofEntities} Entitäten geschrieben.</value>
-        <value xml:lang="en">Wrote JSON for all data in ${numberOfEntities} 
entities.</value>
-        <value xml:lang="fr">Ecrire JSON pour toute les donnée inclues 
${numberOfEntities} Entités.</value>
-        <value xml:lang="it">Scritti JSON per tutti i dati in 
${numberOfEntities} entità.</value>
-        <value xml:lang="ja">${numberOfEntities} 
エンティティのすべてのデータをXMLファイルに書き出しました。</value>
-        <value xml:lang="pt">Escreveu JSON para todos os dados em 
${numberOfEntities} entidades.</value>
-        <value xml:lang="th">เขียน JSON 
สำหรับข้อมูลทั้งหมดใน 
${numberOfEntities} entities.</value>
-        <value xml:lang="vi">Đã ghi JSON cho tất cả dữ liệu trong 
${numberOfEntities} Thực thể.</value>
-        <value xml:lang="zh">为${numberOfEntities}个实体中的å…
¨éƒ¨æ•°æ®å†™åˆ°JSON。</value>
-        <value xml:lang="zh-TW">為${numberOfEntities}個資料實體中的å…
¨éƒ¨è³‡æ–™å¯«åˆ°JSON.</value>
-    </property>
-    <property key="WebtoolsJSONExportInfo">
-        <value xml:lang="de">Hier Seite können Daten aus der Datenbank 
exportiert werden. Es wird für jede Entität in dem für diese webapp 
konfigurierten Delegator eine eigene Datei erstellt.</value>
-        <value xml:lang="en">This page can be used to export data from the 
database. There will be one file for each Entity in the configured delegator 
for this webapp.</value>
-        <value xml:lang="fr">Cette page peut être utilisée pour exporter des 
données depuis la base. Il y aura un fichier créé pour chaque entité dans 
le delegator configuré pour cette webapp.</value>
-        <value xml:lang="it">Questa pagina può essere usata per esportare i 
dati dal database. C'è un file per ogni Entità nel delegator configurato per 
questa applicazione web.</value>
-        <value 
xml:lang="ja">このページでデータベースからデータをエクスポートすることができます。Webアプリケーションに設定されたデリゲータの中のそれぞれのエンティティに対して1つのファイルが作成されます。</value>
-        <value xml:lang="pt">Esta página pode ser utilizado para exportar 
dados do banco de dados. Haverá um arquivo para cada entidade do delegator 
configurado para essa webapp.</value>
-        <value xml:lang="ro">Aceasta pagina poate fi folosita pentru 
exportarea datelor din  database. Exista un file pentru orice Entitate din 
delegatorul configurat pentru aceasta aplicatie web.</value>
-        <value 
xml:lang="th">หน้านี้ใช้การส่งออกข้อมูลจากฐานข้อมูลการส่
 มี 1 ไฟล์สำหรับตัวอย่าง Entity 
ในการสร้างตัวแทนสำหรับโปรแกรมประยุกต์นี้</value>
-        <value xml:lang="vi">Giao diện bạn đang sử dụng cung cấp 
chức năng Kết xuất dữ liệu từ Cơ sở dữ liệu.( có 01 Tập 
tin với mỗi Thực thể của Ứng dụng này)</value>
-        <value xml:lang="zh">本页面用于从数据库导出数据 的根æ 
‡ç­¾åœ¨ä¸ºè¿™ä¸ªåº”用é…
ç½®çš„代表中,会对每个实体有一个文件。</value>
-        <value xml:lang="zh-TW">本頁面用於從資料庫匯出資料 的æ 
¹æ¨™ç°½åœ¨ç‚ºé€™å€‹æ‡‰ç”¨é…
ç½®çš„代表中,會對每個資料實體有一個檔.</value>
-    </property>
     <property key="WebtoolsXMLImportInfo">
         <value xml:lang="de">Hier können zuvor exportierte Entitäten XML 
Dateien wieder in die Datenbank importiert werden. Diese Dokumente haben eine 
XML-root-tag "&lt;entity-engine-xml&gt;".</value>
         <value xml:lang="en">This page can be used to import exported Entity 
Engine XML documents. These documents all have a root tag of 
"&lt;entity-engine-xml&gt;".</value>
@@ -6123,19 +5965,6 @@
         <value xml:lang="zh">本页面用于导å…
¥å¯¼å‡ºçš„实体引擎XML文档。这些文档都有一个根标签 
"&lt;entity-engine-xml&gt;".</value>
         <value xml:lang="zh-TW">本頁面用於匯å…
¥åŒ¯å‡ºçš„資料實體引擎XML檔.這些檔都有一個根標簽 
"&lt;entity-engine-xml&gt;".&lt;/entity-engine-xml&gt;</value>
     </property>
-    <property key="WebtoolsJSONImportInfo">
-        <value xml:lang="de">Hier können zuvor exportierte Entitäten JSON 
Dateien wieder in die Datenbank importiert werden.</value>
-        <value xml:lang="en">This page can be used to import exported Entity 
Engine JSON data.</value>
-        <value xml:lang="fr">Cette page peut être utilisée pour importer des 
documents JSON exportés par le moteur d'entité.".</value>
-        <value xml:lang="it">Questa pagina può essere usata per importare 
documenti JSON contenenti export di Entita'.</value>
-        <value 
xml:lang="ja">このページでエクスポートされたエンティティエンジンJSONドキュメントをインポートすることができます。</value>
-        <value xml:lang="pt">Esta página pode ser utilizado para 
importação e exportação de documentos JSON do Engine de 
Entidades.</value>
-        <value xml:lang="ro">Aceasta pagina nu poate fi folosita pentru 
importarea exportarea documentelor JSON de Entity Engine.</value>
-        <value 
xml:lang="th">หน้านี้ใช้การนำเข้าข้อมูลที่มีการส่งออกเอนติตี้เอนจินเอกสาร
 JSON โดยใช้คำสั่ง</value>
-        <value xml:lang="vi">Giao diện bạn đang sử dụng cung cấp 
chức năng Nhập khẩu dữ liệu từ các Tài liệu Thực thể 
JSON.</value>
-        <value xml:lang="zh">本页面用于导å…
¥å¯¼å‡ºçš„实体引擎JSON文档。</value>
-        <value xml:lang="zh-TW">本頁面用於匯å…
¥åŒ¯å‡ºçš„資料實體引擎JSON檔</value>
-    </property>
     <property key="WebtoolsYouMayCreateAnEntity">
         <value xml:lang="de">You may create an Entity ${entityName} by 
entering the values you want, and clicking Create.</value>
         <value xml:lang="en">You may create an Entity ${entityName} by 
entering the values you want, and clicking Create.</value>

Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/servicedef/services.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/servicedef/services.xml?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webtools/servicedef/services.xml 
(original)
+++ ofbiz/ofbiz-framework/trunk/framework/webtools/servicedef/services.xml Sun 
Sep 22 12:29:54 2019
@@ -56,36 +56,6 @@ under the License.
         <attribute name="placeholderValues" type="java.util.Map" mode="IN" 
optional="true"/>
         <attribute name="messages" type="List" mode="OUT" optional="false"/>
     </service>
-    <service name="parseEntityJsonFile" engine="java"
-             location="org.apache.ofbiz.webtools.WebToolsServices" 
invoke="parseEntityJsonFile" auth="true" use-transaction="false">
-        <description>Parses an entity xml file or an entity xml 
text</description>
-        <permission-service service-name="entityMaintPermCheck" 
main-action="VIEW"/>
-        <attribute name="url" type="java.net.URL" mode="IN" optional="true"/>
-        <attribute name="xmltext" type="String" mode="IN" optional="true" 
allow-html="any"/>
-        <attribute name="onlyInserts" type="String" mode="IN" optional="true"/>
-        <attribute name="maintainTimeStamps" type="String" mode="IN" 
optional="true"/>
-        <attribute name="txTimeout" type="Integer" mode="IN" optional="true"/>
-        <attribute name="createDummyFks" type="String" mode="IN" 
optional="true"/>
-        <attribute name="checkDataOnly" type="String" mode="IN" 
optional="true"/>
-        <attribute name="placeholderValues" type="java.util.Map" mode="IN" 
optional="true"/>
-        <attribute name="rowProcessed" type="Long" mode="OUT" 
optional="false"/>
-    </service>
-    <service name="entityImportJson" engine="java"
-             location="org.apache.ofbiz.webtools.WebToolsServices" 
invoke="entityImportJson" auth="true" use-transaction="false">
-        <description>Imports an entity xml file or text string</description>
-        <permission-service service-name="entityMaintPermCheck" 
main-action="VIEW"/>
-        <attribute name="filename" type="String" mode="IN" optional="true" 
allow-html="any"/>
-        <attribute name="fmfilename" type="String" mode="IN" optional="true" 
allow-html="any"/>
-        <attribute name="fulltext" type="String" mode="IN" optional="true" 
allow-html="any"/>
-        <attribute name="isUrl" type="String" mode="IN" optional="true"/>
-        <attribute name="onlyInserts" type="String" mode="IN" optional="true"/>
-        <attribute name="maintainTimeStamps" type="String" mode="IN" 
optional="true"/>
-        <attribute name="createDummyFks" type="String" mode="IN" 
optional="true"/>
-        <attribute name="checkDataOnly" type="String" mode="IN" 
optional="true"/>
-        <attribute name="txTimeout" type="Integer" mode="IN" optional="true"/>
-        <attribute name="placeholderValues" type="java.util.Map" mode="IN" 
optional="true"/>
-        <attribute name="messages" type="List" mode="OUT" optional="false"/>
-    </service>
     <service name="entityImportDir" engine="java"
             location="org.apache.ofbiz.webtools.WebToolsServices" 
invoke="entityImportDir" auth="true" use-transaction="false">
         <description>Imports all entity xml files contained in a 
directory</description>
@@ -101,21 +71,6 @@ under the License.
         <attribute name="placeholderValues" type="java.util.Map" mode="IN" 
optional="true"/>
         <attribute name="messages" type="List" mode="OUT" optional="false"/>
     </service>
-    <service name="entityImportDirJson" engine="java"
-             location="org.apache.ofbiz.webtools.WebToolsServices" 
invoke="entityImportDirJson" auth="true" use-transaction="false">
-        <description>Imports all entity json files contained in a 
directory</description>
-        <permission-service service-name="entityMaintPermCheck" 
main-action="VIEW"/>
-        <attribute name="path" type="String" mode="IN" optional="true"/>
-        <attribute name="onlyInserts" type="String" mode="IN" optional="true"/>
-        <attribute name="maintainTimeStamps" type="String" mode="IN" 
optional="true"/>
-        <attribute name="createDummyFks" type="String" mode="IN" 
optional="true"/>
-        <attribute name="checkDataOnly" type="String" mode="IN" 
optional="true"/>
-        <attribute name="deleteFiles" type="String" mode="IN" optional="true"/>
-        <attribute name="txTimeout" type="Integer" mode="IN" optional="true"/>
-        <attribute name="filePause" type="Long" mode="IN" optional="true"/>
-        <attribute name="placeholderValues" type="java.util.Map" mode="IN" 
optional="true"/>
-        <attribute name="messages" type="List" mode="OUT" optional="false"/>
-    </service>
     <service name="entityImportReaders" engine="java"
         location="org.apache.ofbiz.webtools.WebToolsServices" 
invoke="entityImportReaders" auth="true" use-transaction="false">
         <description>Imports an entity xml file or text string</description>
@@ -136,15 +91,6 @@ under the License.
         <permission-service service-name="entityMaintPermCheck" 
main-action="VIEW"/>
         <attribute name="outpath" type="String" mode="IN" optional="true"/>
         <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
-        <attribute name="txTimeout" type="Integer" mode="IN" optional="true"/>
-        <attribute name="results" type="List" mode="OUT" optional="false"/>
-    </service>
-    <service name="entityExportAllJson" engine="java"
-             location="org.apache.ofbiz.webtools.WebToolsServices" 
invoke="entityExportAllJson" auth="true" use-transaction="false">
-        <description>Exports all entities into json files</description>
-        <permission-service service-name="entityMaintPermCheck" 
main-action="VIEW"/>
-        <attribute name="outpath" type="String" mode="IN" optional="true"/>
-        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
         <attribute name="txTimeout" type="Integer" mode="IN" optional="true"/>
         <attribute name="results" type="List" mode="OUT" optional="false"/>
     </service>

Modified: 
ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
 Sun Sep 22 12:29:54 2019
@@ -80,7 +80,6 @@ import org.apache.ofbiz.entity.transacti
 import org.apache.ofbiz.entity.transaction.TransactionUtil;
 import org.apache.ofbiz.entity.util.EntityDataAssert;
 import org.apache.ofbiz.entity.util.EntityDataLoader;
-import org.apache.ofbiz.entity.util.EntityJsonReader;
 import org.apache.ofbiz.entity.util.EntityListIterator;
 import org.apache.ofbiz.entity.util.EntityQuery;
 import org.apache.ofbiz.entity.util.EntitySaxReader;
@@ -313,226 +312,6 @@ public class WebToolsServices {
         return resp;
     }
 
-    /**
-     *
-     * @param dctx
-     * @param context
-     * @return
-     */
-    public static Map<String, Object> entityImportJson(DispatchContext dctx, 
Map<String, ? extends Object> context) {
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
-        LocalDispatcher dispatcher = dctx.getDispatcher();
-        Locale locale = (Locale) context.get("locale");
-        List<String> messages = new LinkedList<>();
-
-        String filename = (String)context.get("filename");
-        String fmfilename = (String)context.get("fmfilename");
-        String fulltext = (String)context.get("fulltext");
-        boolean isUrl = (String)context.get("isUrl") != null;
-        String onlyInserts = (String)context.get("onlyInserts");
-        String maintainTimeStamps = (String)context.get("maintainTimeStamps");
-        String createDummyFks = (String)context.get("createDummyFks");
-        String checkDataOnly = (String) context.get("checkDataOnly");
-        Map<String, Object> placeholderValues = 
UtilGenerics.cast(context.get("placeholderValues"));
-
-        Integer txTimeout = (Integer)context.get("txTimeout");
-        if (txTimeout == null) {
-            txTimeout = 7200;
-        }
-        URL url = null;
-
-        // #############################
-        // The filename to parse is prepared
-        // #############################
-        if (UtilValidate.isNotEmpty(filename)) {
-            try {
-                url = 
isUrl?FlexibleLocation.resolveLocation(filename):UtilURL.fromFilename(filename);
-            } catch (MalformedURLException mue) {
-                return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"WebtoolsInvalidFileName", UtilMisc.toMap("filename", filename, "errorString", 
mue.getMessage()), locale));
-            } catch (Exception exc) {
-                return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"WebtoolsErrorReadingFileName", UtilMisc.toMap("filename", filename, 
"errorString", exc.getMessage()), locale));
-            }
-        }
-
-        // #############################
-        // FM Template
-        // #############################
-        if (UtilValidate.isNotEmpty(fmfilename) && 
(UtilValidate.isNotEmpty(fulltext) || url != null)) {
-            File fmFile = new File(fmfilename);
-            if (!fmFile.exists()) {
-                return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"WebtoolsErrorReadingTemplateFile", UtilMisc.toMap("filename", fmfilename, 
"errorString", "Template file not found."), locale));
-            }
-            try {
-                DocumentBuilder documentBuilder = 
DocumentBuilderFactory.newInstance().newDocumentBuilder();
-                InputSource ins = url != null ? new 
InputSource(url.openStream()) : new InputSource(new StringReader(fulltext));
-                Document doc;
-                try {
-                    doc = documentBuilder.parse(ins);
-                } finally {
-                    if (ins.getByteStream() != null) {
-                        ins.getByteStream().close();
-                    }
-                    if (ins.getCharacterStream() != null) {
-                        ins.getCharacterStream().close();
-                    }
-                }
-                StringWriter outWriter = new StringWriter();
-                Map<String, Object> fmcontext = new HashMap<>();
-                fmcontext.put("doc", doc);
-                
FreeMarkerWorker.renderTemplate(fmFile.toURI().toURL().toString(), fmcontext, 
outWriter);
-                fulltext = outWriter.toString();
-            } catch (Exception ex) {
-                return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"WebtoolsErrorProcessingTemplateFile", UtilMisc.toMap("filename", fmfilename, 
"errorString", ex.getMessage()), locale));
-            }
-        }
-
-        // #############################
-        // The parsing takes place
-        // #############################
-        if (fulltext != null || url != null) {
-            try {
-                Map<String, Object> inputMap = UtilMisc.toMap("onlyInserts", 
onlyInserts,
-                        "createDummyFks", createDummyFks,
-                        "checkDataOnly", checkDataOnly,
-                        "maintainTimeStamps", maintainTimeStamps,
-                        "txTimeout", txTimeout,
-                        "placeholderValues", placeholderValues,
-                        "userLogin", userLogin);
-                if (fulltext != null) {
-                    inputMap.put("xmltext", fulltext);
-                } else {
-                    inputMap.put("url", url);
-                }
-                Map<String, Object> outputMap = 
dispatcher.runSync("parseEntityJsonFile", inputMap);
-                if (ServiceUtil.isError(outputMap)) {
-                    return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"WebtoolsErrorParsingFile", UtilMisc.toMap("errorString", 
ServiceUtil.getErrorMessage(outputMap)), locale));
-                } else {
-                    Long numberRead = (Long)outputMap.get("rowProcessed");
-                    messages.add(UtilProperties.getMessage(resource, 
"EntityImportRowProcessed", UtilMisc.toMap("numberRead", 
numberRead.toString()), locale));
-                }
-            } catch (GenericServiceException gsex) {
-                return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"EntityImportJsonParsingError", UtilMisc.toMap("errorString", 
gsex.getMessage()), locale));
-            } catch (Exception ex) {
-                return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"EntityImportJsonParsingError", UtilMisc.toMap("errorString", ex.getMessage()), 
locale));
-            }
-        } else {
-            messages.add(UtilProperties.getMessage(resource, 
"EntityImportNoJsonFileSpecified", locale));
-        }
-
-        // send the notification
-        Map<String, Object> resp = UtilMisc.toMap("messages", (Object) 
messages);
-        return resp;
-    }
-
-    /**
-     *
-     * @param dctx
-     * @param context
-     * @return
-     */
-    public static Map<String, Object> entityImportDirJson(DispatchContext 
dctx, Map<String, ? extends Object> context) {
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
-        LocalDispatcher dispatcher = dctx.getDispatcher();
-        Locale locale = (Locale) context.get("locale");
-        List<String> messages = new LinkedList<>();
-
-        String path = (String) context.get("path");
-        String onlyInserts = (String) context.get("onlyInserts");
-        String maintainTimeStamps = (String) context.get("maintainTimeStamps");
-        String createDummyFks = (String) context.get("createDummyFks");
-        boolean deleteFiles = (String) context.get("deleteFiles") != null;
-        String checkDataOnly = (String) context.get("checkDataOnly");
-        Map<String, Object> placeholderValues = 
UtilGenerics.cast(context.get("placeholderValues"));
-
-        Integer txTimeout = (Integer)context.get("txTimeout");
-        Long filePause = (Long)context.get("filePause");
-
-        if (txTimeout == null) {
-            txTimeout = 7200;
-        }
-        if (filePause == null) {
-            filePause = 0L;
-        }
-
-        if (UtilValidate.isNotEmpty(path)) {
-            long pauseLong = filePause;
-            File baseDir = new File(path);
-
-            if (baseDir.isDirectory() && baseDir.canRead()) {
-                File[] fileArray = baseDir.listFiles();
-                List<File> files = new LinkedList<>();
-                for (File file: fileArray) {
-                    if (file.getName().toUpperCase().endsWith("JSON")) {
-                        files.add(file);
-                    }
-                }
-
-                int passes=0;
-                int initialListSize = files.size();
-                int lastUnprocessedFilesCount = 0;
-                List<File> unprocessedFiles = new LinkedList<>();
-                while (files.size()>0 &&
-                        files.size() != lastUnprocessedFilesCount) {
-                    lastUnprocessedFilesCount = files.size();
-                    unprocessedFiles = new LinkedList<>();
-                    for (File f: files) {
-                        Map<String, Object> parseEntityXmlFileArgs = 
UtilMisc.toMap("onlyInserts", onlyInserts,
-                                "createDummyFks", createDummyFks,
-                                "checkDataOnly", checkDataOnly,
-                                "maintainTimeStamps", maintainTimeStamps,
-                                "txTimeout", txTimeout,
-                                "placeholderValues", placeholderValues,
-                                "userLogin", userLogin);
-
-                        try {
-                            URL furl = f.toURI().toURL();
-                            parseEntityXmlFileArgs.put("url", furl);
-                            Map<String, Object> outputMap = 
dispatcher.runSync("parseEntityJsonFile", parseEntityXmlFileArgs);
-                            Long numberRead = (Long) 
outputMap.get("rowProcessed");
-                            messages.add(UtilProperties.getMessage(resource, 
"EntityImportNumberOfEntityToBeProcessed", UtilMisc.toMap("numberRead", 
numberRead.toString(), "fileName", f.getName()), locale));
-                            if (deleteFiles) {
-                                
messages.add(UtilProperties.getMessage(resource, "EntityImportDeletFile", 
UtilMisc.toMap("fileName", f.getName()), locale));
-                                f.delete();
-                            }
-                        } catch (Exception e) {
-                            unprocessedFiles.add(f);
-                            messages.add(UtilProperties.getMessage(resource, 
"EntityImportFailedFile", UtilMisc.toMap("fileName", f.getName()), locale));
-                        }
-                        // pause in between files
-                        if (pauseLong > 0) {
-                            Debug.logInfo("Pausing for [" + pauseLong + "] 
seconds - " + UtilDateTime.nowTimestamp(), module);
-                            try {
-                                Thread.sleep((pauseLong * 1000));
-                            } catch (InterruptedException ie) {
-                                Debug.logInfo("Pause finished - " + 
UtilDateTime.nowTimestamp(), module);
-                            }
-                        }
-                    }
-                    files = unprocessedFiles;
-                    passes++;
-                    messages.add(UtilProperties.getMessage(resource, 
"EntityImportPassedFile", UtilMisc.toMap("passes", passes), locale));
-                    Debug.logInfo("Pass " + passes + " complete", module);
-                }
-                lastUnprocessedFilesCount=unprocessedFiles.size();
-                messages.add("---------------------------------------");
-                messages.add(UtilProperties.getMessage(resource, 
"EntityImportSucceededNumberFile", UtilMisc.toMap("succeeded", 
(initialListSize-lastUnprocessedFilesCount), "total", initialListSize), 
locale));
-                messages.add(UtilProperties.getMessage(resource, 
"EntityImportFailedNumberFile", UtilMisc.toMap("failed", 
lastUnprocessedFilesCount, "total", initialListSize), locale));
-                messages.add("---------------------------------------");
-                messages.add(UtilProperties.getMessage(resource, 
"EntityImportFailedFileList", locale));
-                for (File file: unprocessedFiles) {
-                    messages.add(file.toString());
-                }
-            } else {
-                messages.add(UtilProperties.getMessage(resource, 
"EntityImportPathNotFound", locale));
-            }
-        } else {
-            messages.add(UtilProperties.getMessage(resource, 
"EntityImportPathNotSpecified", locale));
-        }
-        // send the notification
-        Map<String, Object> resp = UtilMisc.toMap("messages", (Object) 
messages);
-        return resp;
-    }
-
     public static Map<String, Object> entityImportReaders(DispatchContext 
dctx, Map<String, Object> context) {
         String readers = (String) context.get("readers");
         String overrideDelegator = (String) context.get("overrideDelegator");
@@ -684,46 +463,6 @@ public class WebToolsServices {
         return resp;
     }
 
-    public static Map<String, Object> parseEntityJsonFile(DispatchContext 
dctx, Map<String, ? extends Object> context) {
-        Delegator delegator = dctx.getDelegator();
-        Locale locale = (Locale) context.get("locale");
-        URL url = (URL) context.get("url");
-        String xmltext = (String) context.get("xmltext");
-
-        if (url == null && xmltext == null) {
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"EntityImportNoXmlFileOrTextSpecified", locale));
-        }
-        boolean onlyInserts = (String) context.get("onlyInserts") != null;
-        boolean maintainTimeStamps = (String) 
context.get("maintainTimeStamps") != null;
-        boolean createDummyFks = (String) context.get("createDummyFks") != 
null;
-        boolean checkDataOnly = (String) context.get("checkDataOnly") != null;
-        Integer txTimeout = (Integer) context.get("txTimeout");
-        Map<String, Object> placeholderValues = 
UtilGenerics.cast(context.get("placeholderValues"));
-
-        if (txTimeout == null) {
-            txTimeout = 7200;
-        }
-
-        long rowProcessed = 0;
-        try {
-            EntityJsonReader reader = new EntityJsonReader(delegator);
-            reader.setUseTryInsertMethod(onlyInserts);
-            reader.setMaintainTxStamps(maintainTimeStamps);
-            reader.setTransactionTimeout(txTimeout);
-            reader.setCreateDummyFks(createDummyFks);
-            reader.setCheckDataOnly(checkDataOnly);
-            reader.setPlaceholderValues(placeholderValues);
-
-            long numberRead = (url != null ? reader.parse(url) : 
reader.parse(xmltext));
-            rowProcessed = numberRead;
-        } catch (Exception ex) {
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"EntityImportJsonParsingError", UtilMisc.toMap("errorString", ex.toString()), 
locale));
-        }
-        // send the notification
-        Map<String, Object> resp = UtilMisc.<String, 
Object>toMap("rowProcessed", rowProcessed);
-        return resp;
-    }
-
     public static Map<String, Object> entityExportAll(DispatchContext dctx, 
Map<String, ? extends Object> context) {
         Delegator delegator = dctx.getDelegator();
         Locale locale = (Locale) context.get("locale");
@@ -797,110 +536,6 @@ public class WebToolsServices {
                             continue;
                         }
                         fileNumber++;
-                    } catch (GenericTransactionException e) {
-                        Debug.logError(e, module);
-                        results.add(e.getLocalizedMessage());
-                    }
-                }
-            } else {
-                results.add("Path not found or no write access.");
-            }
-        } else {
-            results.add("No path specified, doing nothing.");
-        }
-        // send the notification
-        Map<String, Object> resp = UtilMisc.<String, Object>toMap("results", 
results);
-        return resp;
-    }
-
-    public static Map<String, Object> entityExportAllJson(DispatchContext 
dctx, Map<String, ? extends Object> context) {
-        Delegator delegator = dctx.getDelegator();
-        Locale locale = (Locale) context.get("locale");
-        String outpath = (String) context.get("outpath"); // mandatory
-        Timestamp fromDate = (Timestamp) context.get("fromDate");
-        Integer txTimeout = (Integer) context.get("txTimeout");
-        if (txTimeout == null) {
-            txTimeout = 7200;
-        }
-
-        List<String> results = new LinkedList<>();
-
-        if (UtilValidate.isNotEmpty(outpath)) {
-            File outdir = new File(outpath);
-            if (!outdir.exists()) {
-                outdir.mkdir();
-            }
-            if (outdir.isDirectory() && outdir.canWrite()) {
-                Set<String> passedEntityNames;
-                try {
-                    ModelReader reader = delegator.getModelReader();
-                    Collection<String> ec = reader.getEntityNames();
-                    passedEntityNames = new TreeSet<>(ec);
-                } catch (Exception exc) {
-                    return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"EntityImportErrorRetrievingEntityNames", locale));
-                }
-                int fileNumber = 1;
-
-                for (String curEntityName : passedEntityNames) {
-                    long numberWritten = 0;
-                    ModelEntity me = delegator.getModelEntity(curEntityName);
-                    if (me instanceof ModelViewEntity) {
-                        results.add("[" + fileNumber + "] [vvv] " + 
curEntityName + " skipping view entity");
-                        continue;
-                    }
-                    List<EntityCondition> conds = new LinkedList<>();
-                    if (UtilValidate.isNotEmpty(fromDate)) {
-                        
conds.add(EntityCondition.makeCondition("createdStamp", 
EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
-                    }
-                    EntityQuery eq = 
EntityQuery.use(delegator).from(curEntityName).where(conds).orderBy(me.getPkFieldNames());
-
-                    try {
-                        boolean beganTx = TransactionUtil.begin();
-                        // some databases don't support cursors, or other 
problems may happen, so if there is an error here log it and move on to get as 
much as possible
-                        //Don't bother writing the file if there's nothing to 
put into it
-                        try (EntityListIterator values = eq.queryIterator()) {
-                            GenericValue value = values.next();
-                            if (value != null) {
-                                int curValueCount = 0;
-                                try (PrintWriter writer = new PrintWriter(new 
BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(outdir, 
curEntityName + ".json")), "UTF-8")))) {
-                                    writer.println("[");
-                                    writer.print("{");
-                                    boolean isFirst = true;
-                                    do {
-                                        if (isFirst) {
-                                            writer.print('"');
-                                            writer.print(curEntityName);
-                                            writer.print('"');
-                                            writer.print(':');
-                                            writer.print('[');
-                                            isFirst = false;
-                                        }
-                                        EntityJsonHelper.writeJsonText(writer, 
value);
-                                        curValueCount++;
-                                        numberWritten++;
-                                        if(curValueCount < 
values.getResultsSizeAfterPartialList()) {
-                                            writer.println(',');
-                                        }
-                                        if (numberWritten % 500 == 0) {
-                                            TransactionUtil.commit(beganTx);
-                                            beganTx = TransactionUtil.begin();
-                                        }
-                                    } while ((value = values.next()) != null);
-                                    writer.println("]}");
-                                    writer.print("]");
-                                } catch (UnsupportedEncodingException | 
FileNotFoundException e) {
-                                    results.add("[" + fileNumber + "] [xxx] 
Error when writing " + curEntityName + ": " + e);
-                                }
-                                results.add("[" + fileNumber + "] [" + 
numberWritten + "] " + curEntityName + " wrote " + numberWritten + " records");
-                            } else {
-                                results.add("[" + fileNumber + "] [---] " + 
curEntityName + " has no records, not writing file");
-                            }
-                            TransactionUtil.commit(beganTx);
-                        } catch (GenericEntityException entityEx) {
-                            results.add("[" + fileNumber + "] [xxx] Error when 
writing " + curEntityName + ": " + entityEx);
-                            continue;
-                        }
-                        fileNumber++;
                     } catch (GenericTransactionException e) {
                         Debug.logError(e, module);
                         results.add(e.getLocalizedMessage());

Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/template/Main.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/template/Main.ftl?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webtools/template/Main.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/framework/webtools/template/Main.ftl Sun Sep 22 
12:29:54 2019
@@ -80,12 +80,6 @@ under the License.
           <li><a 
href="<@ofbizUrl>EntityImport</@ofbizUrl>">${uiLabelMap.PageTitleEntityImport}</a></li>
           <li><a 
href="<@ofbizUrl>EntityImportDir</@ofbizUrl>">${uiLabelMap.PageTitleEntityImportDir}</a></li>
           <li><a 
href="<@ofbizUrl>EntityImportReaders</@ofbizUrl>">${uiLabelMap.PageTitleEntityImportReaders}</a></li>
-
-          <li><h3>${uiLabelMap.WebtoolsEntityJSONTools}</h3></li>
-          <li><a 
href="<@ofbizUrl>jsondsdump</@ofbizUrl>">${uiLabelMap.PageTitleEntityExportJson}</a></li>
-          <li><a 
href="<@ofbizUrl>EntityExportAllJson</@ofbizUrl>">${uiLabelMap.PageTitleEntityExportAllJson}</a></li>
-          <li><a 
href="<@ofbizUrl>EntityImportJson</@ofbizUrl>">${uiLabelMap.PageTitleEntityImportJson}</a></li>
-          <li><a 
href="<@ofbizUrl>EntityImportDirJson</@ofbizUrl>">${uiLabelMap.PageTitleEntityImportDirJson}</a></li>
         </#if>
         <#if security.hasPermission("SERVICE_MAINT", session)>
           <li><h3>${uiLabelMap.WebtoolsServiceEngineTools}</h3></li>

Modified: 
ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
 Sun Sep 22 12:29:54 2019
@@ -426,27 +426,6 @@ under the License.
         <response name="success" type="view" value="EntityImport"/>
         <response name="error" type="view" value="EntityImport"/>
     </request-map>
-    <request-map uri="EntityImportJson"><security https="true" 
auth="true"/><response name="success" type="view" 
value="EntityImportJson"/></request-map>
-    <request-map uri="entityImportJson">
-        <security https="true" auth="true"/>
-        <event type="service" path="" invoke="entityImportJson"/>
-        <response name="success" type="view" value="EntityImportJson"/>
-        <response name="error" type="view" value="EntityImportJson"/>
-    </request-map>
-    <request-map uri="EntityExportAllJson"><security https="true" 
auth="true"/><response name="success" type="view" 
value="EntityExportAllJson"/><response name="error" type="view" 
value="EntityExportAllJson"/></request-map>
-    <request-map uri="entityExportAllJson">
-        <security https="true" auth="true"/>
-        <event type="service" path="" invoke="entityExportAllJson"/>
-        <response name="success" type="view" value="EntityExportAllJson"/>
-        <response name="error" type="view" value="EntityExportAllJson"/>
-    </request-map>
-    <request-map uri="EntityImportDirJson"><security https="true" 
auth="true"/><response name="success" type="view" 
value="EntityImportDirJson"/></request-map>
-    <request-map uri="entityImportDirJson">
-        <security https="true" auth="true"/>
-        <event type="service" path="" invoke="entityImportDirJson"/>
-        <response name="success" type="view" value="EntityImportDir"/>
-        <response name="error" type="view" value="EntityImportDir"/>
-    </request-map>
     <request-map uri="EntityImportReaders"><security https="true" 
auth="true"/><response name="success" type="view" 
value="EntityImportReaders"/></request-map>
     <request-map uri="entityImportReaders">
         <security https="true" auth="true"/>
@@ -462,15 +441,6 @@ under the License.
         <security https="true" auth="true"/>
         <response name="success" type="view" value="xmldsrawdump"/>
     </request-map>
-    <request-map uri="jsondsdump">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="jsondsdump"/>
-    </request-map>
-    <request-map uri="jsondsrawdump">
-        <security https="true" auth="true"/>
-        <event type="java" path="org.apache.ofbiz.webtools.EntityJsonEvents" 
invoke="downloadJsonData" />
-        <response name="success" type="view" value="jsondsdump"/>
-    </request-map>
 
     <!-- EntitySync requests -->
     <request-map uri="EntitySyncStatus"><security https="true" 
auth="true"/><response name="success" type="view" 
value="EntitySyncStatus"/></request-map>
@@ -630,9 +600,7 @@ under the License.
 
     <view-map name="checkdb" type="screen" 
page="component://webtools/widget/EntityScreens.xml#CheckDb"/>
     <view-map name="xmldsdump" type="screen" 
page="component://webtools/widget/EntityScreens.xml#xmldsdump"/>
-    <view-map name="jsondsdump" type="screen" 
page="component://webtools/widget/EntityScreens.xml#jsondsdump"/>
     <view-map name="xmldsrawdump" page="template/entity/xmldsrawdump.jsp"/>
-    <view-map name="jsondsrawdump" page="template/entity/jsondsrawdump.jsp"/>
 
     <view-map name="FindUtilCache" type="screen" 
page="component://webtools/widget/CacheScreens.xml#FindUtilCache"/>
     <view-map name="FindUtilCacheElements" type="screen" 
page="component://webtools/widget/CacheScreens.xml#FindUtilCacheElements"/>
@@ -671,12 +639,9 @@ under the License.
     <view-map name="EntitySQLProcessor" type="screen" 
page="component://webtools/widget/EntityScreens.xml#EntitySQLProcessor"/>
     <view-map name="ConnectionPoolStatus" type="screen" 
page="component://webtools/widget/EntityScreens.xml#ConnectionPoolStatus"/>
     <view-map name="EntityExportAll" type="screen" 
page="component://webtools/widget/EntityScreens.xml#EntityExportAll"/>
-    <view-map name="EntityExportAllJson" type="screen" 
page="component://webtools/widget/EntityScreens.xml#EntityExportAllJson"/>
     <view-map name="ProgramExport" type="screen" 
page="component://webtools/widget/EntityScreens.xml#ProgramExport"/>
     <view-map name="EntityImportDir" type="screen" 
page="component://webtools/widget/EntityScreens.xml#EntityImportDir"/>
-    <view-map name="EntityImportDirJson" type="screen" 
page="component://webtools/widget/EntityScreens.xml#EntityImportDirJson"/>
     <view-map name="EntityImport" type="screen" 
page="component://webtools/widget/EntityScreens.xml#EntityImport"/>
-    <view-map name="EntityImportJson" type="screen" 
page="component://webtools/widget/EntityScreens.xml#EntityImportJson"/>
     <view-map name="EntityImportReaders" type="screen" 
page="component://webtools/widget/EntityScreens.xml#EntityImportReaders"/>
 
     <!-- cert views -->

Modified: 
ofbiz/ofbiz-framework/trunk/framework/webtools/widget/EntityScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/widget/EntityScreens.xml?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webtools/widget/EntityScreens.xml 
(original)
+++ ofbiz/ofbiz-framework/trunk/framework/webtools/widget/EntityScreens.xml Sun 
Sep 22 12:29:54 2019
@@ -71,27 +71,6 @@ under the License.
             </widgets>
         </section>
     </screen>
-    <screen name="EntityExportAllJson">
-        <section>
-            <actions>
-                <set field="titleProperty" 
value="PageTitleEntityExportAllJson"/>
-                <set field="tabButtonItem" value="entityExportAllJson"/>
-                <set field="parameters.TRANSACTION_TIMEOUT" value="7200"/>
-                <set field="results" from-field="parameters.results"/>
-            </actions>
-            <widgets>
-                <decorator-screen name="CommonImportExportDecorator" 
location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">
-                        <screenlet>
-                            <platform-specific>
-                                <html><html-template 
location="component://webtools/template/entity/EntityExportAllJson.ftl"/></html>
-                            </platform-specific>
-                        </screenlet>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-        </section>
-    </screen>
     <screen name="ProgramExport">
         <section>
             <actions>
@@ -137,28 +116,6 @@ under the License.
             </widgets>
         </section>
     </screen>
-    <screen name="EntityImportDirJson">
-        <section>
-            <actions>
-                <set field="titleProperty" 
value="PageTitleEntityImportDirJson"/>
-                <set field="tabButtonItem" value="entityImportDirJson"/>
-                <set field="parameters.TRANSACTION_TIMEOUT" value="7200"/>
-
-                <set field="messages" from-field="parameters.messages"/>
-            </actions>
-            <widgets>
-                <decorator-screen name="CommonImportExportDecorator" 
location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">
-                        <screenlet>
-                            <platform-specific>
-                                <html><html-template 
location="component://webtools/template/entity/EntityImportDirJson.ftl"/></html>
-                            </platform-specific>
-                        </screenlet>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-        </section>
-    </screen>
     <screen name="EntityImport">
         <section>
             <actions>
@@ -181,28 +138,6 @@ under the License.
             </widgets>
         </section>
     </screen>
-    <screen name="EntityImportJson">
-        <section>
-            <actions>
-                <set field="titleProperty" value="PageTitleEntityImportJson"/>
-                <set field="tabButtonItem" value="entityImportJson"/>
-                <set field="parameters.TRANSACTION_TIMEOUT" value="7200"/>
-
-                <set field="messages" from-field="parameters.messages"/>
-            </actions>
-            <widgets>
-                <decorator-screen name="CommonImportExportDecorator" 
location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">
-                        <screenlet>
-                            <platform-specific>
-                                <html><html-template 
location="component://webtools/template/entity/EntityImportJson.ftl"/></html>
-                            </platform-specific>
-                        </screenlet>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-        </section>
-    </screen>
     <screen name="EntityImportReaders">
         <section>
             <actions>
@@ -539,28 +474,6 @@ under the License.
                         </screenlet>
                     </decorator-section>
                 </decorator-screen>
-            </widgets>
-        </section>
-    </screen>
-
-    <screen name="jsondsdump">
-        <section>
-            <actions>
-                <property-map resource="WebtoolsUiLabels" 
map-name="uiLabelMap" global="true"/>
-                <set field="titleProperty" value="PageTitleEntityExportJson"/>
-                <set field="tabButtonItem" value="jsonDsDump"/>
-                <set field="entityFrom" from-field="parameters.entityFrom" 
type="Timestamp"/>
-                <set field="entityThru" from-field="parameters.entityThru" 
type="Timestamp"/>
-                <script 
location="component://webtools/groovyScripts/entity/JsonDsDump.groovy"/>
-            </actions>
-            <widgets>
-                <decorator-screen name="CommonImportExportDecorator" 
location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">
-                        <screenlet>
-                            <platform-specific><html><html-template 
location="component://webtools/template/entity/JsonDsDump.ftl"/></html></platform-specific>
-                        </screenlet>
-                    </decorator-section>
-                </decorator-screen>
             </widgets>
         </section>
     </screen>

Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/widget/Menus.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/widget/Menus.xml?rev=1867342&r1=1867341&r2=1867342&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webtools/widget/Menus.xml (original)
+++ ofbiz/ofbiz-framework/trunk/framework/webtools/widget/Menus.xml Sun Sep 22 
12:29:54 2019
@@ -98,18 +98,6 @@ under the License.
         <menu-item name="entityImportReaders" 
title="${uiLabelMap.PageTitleEntityImportReaders}">
             <link target="EntityImportReaders"/>
         </menu-item>
-        <menu-item name="jsonDsDump" 
title="${uiLabelMap.PageTitleEntityExportJson}">
-            <link target="jsondsdump"/>
-        </menu-item>
-        <menu-item name="entityExportAllJson" 
title="${uiLabelMap.PageTitleEntityExportAllJson}">
-            <link target="EntityExportAllJson"/>
-        </menu-item>
-        <menu-item name="entityImportJson" 
title="${uiLabelMap.PageTitleEntityImportJson}">
-            <link target="EntityImportJson"/>
-        </menu-item>
-        <menu-item name="entityImportDirJson" 
title="${uiLabelMap.PageTitleEntityImportDirJson}">
-            <link target="EntityImportDirJson"/>
-        </menu-item>
     </menu>
     
     <menu name="ServiceTabBar" extends="CommonTabBarMenu" 
extends-resource="component://common/widget/CommonMenus.xml"


Reply via email to