]> 91.132.146.200 Git - bibliotheca-tools.git/commitdiff
inital commit after splitting
authorBanana <mail@bananas-playground.net>
Wed, 30 Dec 2020 11:55:00 +0000 (12:55 +0100)
committerBanana <mail@bananas-playground.net>
Wed, 30 Dec 2020 11:55:00 +0000 (12:55 +0100)
21 files changed:
.gitignore [new file with mode: 0644]
LICENSE [new file with mode: 0644]
README [new file with mode: 0644]
data-crow/README [new file with mode: 0644]
data-crow/datacrowimport.class.php [new file with mode: 0644]
data-crow/import-mapping-example.json [new file with mode: 0644]
data-crow/import/game/games-export.xml [new file with mode: 0644]
data-crow/import/game/games-export.xsd [new file with mode: 0644]
data-crow/import/game/games-export_images/04b34ba9-6ae3-4aae-b752-9377e6da7dee_PictureFront.jpg [new file with mode: 0644]
data-crow/import/game/import-mapping.json [new file with mode: 0644]
data-crow/import/movie/import-mapping.json [new file with mode: 0644]
data-crow/import/movie/movies-export.xml [new file with mode: 0644]
data-crow/import/movie/movies-export.xsd [new file with mode: 0644]
data-crow/import/movie/movies-export_images/00330b7f-5df8-49fa-ad79-2d1eb8ebb38c_PictureFront.jpg [new file with mode: 0644]
data-crow/import/movie/movies-export_images/0efb720d-d9e5-406b-aa42-e356f9c544e9_PictureFront.jpg [new file with mode: 0644]
data-crow/import/movie/movies-export_images/3edf49eb-0270-456d-a15d-e5ddcba302ed_PictureFront.jpg [new file with mode: 0644]
data-crow/import/movie/movies-export_images/a5c41732-a600-405e-bab4-c3fa24745277_PictureFront.jpg [new file with mode: 0644]
data-crow/markdown-template-example.md [new file with mode: 0644]
data-crow/output/.gitignore [new file with mode: 0644]
data-crow/run-import-to-bibliotheca.php [new file with mode: 0644]
data-crow/run-import-to-static-md.php [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..b6974b2
--- /dev/null
@@ -0,0 +1,6 @@
+.idea/
+.buildpath
+.project
+.settings/
+*.iml
+*.log
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..c1a81fe
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+    Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
\ No newline at end of file
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..e1d40bd
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+Various tools for https://www.bananas-playground.net/projekt/bibliotheca/
\ No newline at end of file
diff --git a/data-crow/README b/data-crow/README
new file mode 100644 (file)
index 0000000..e67ecc1
--- /dev/null
@@ -0,0 +1,78 @@
+# Requirements
+
+PHP installed as CLI with a minimum version of 7
+
+########################################################################################################################
+# run-import-to-bibliotheca
+
+This can be used to import the content of a xml export from Datacrow (http://www.datacrow.net/) into Bibliotheca
+database.
+
+Requirements:
+- php installed as cli
+- the xml export file in the import folder. Any additional files, like images go there too.
+- the import-mapping.json file in the import folder. This file defines which data goes where in the database.
+Use the import-mapping-example.json as a base and copy it into the import folder.
+- API token
+- The ID of your collection you want to import the data into
+- The structure of the api call for your colleciton. This can requested by calling the api. See the api
+docu for this.
+
+import-mapping.json
+Defines which xml element from the xml export file will be used. Name of the item goes into the element entry.
+The files array defines which field of the xml element goes where in the database.
+Into has to start with file_
+Minimum is the into with an target string.
+child defines that the element has children which will be used to create a comma seperated string defined by
+valuefield.
+method defines a method in datacrowimport.class.php which will be used to alter the data befor writing it into the
+database. The string and a prefix of _modify_ will be used as the method name within the php class
+
+Usage:
+Make sure you read the requirements and copied over the example files. Alter them to your needs.
+Modify the run-import-to-bibliotheca.php and updated all the info there. Alter the curl payload to your needs.
+The run run-import-to-bibliotheca.php file. Any error or missconfig should be printed as an error in the import-error.log
+file.
+
+    php -f run-import-to-bibliotheca.php
+
+
+########################################################################################################################
+# run-import-to-static-md.php
+
+This can be used to create static content of a xml export from Datacrow (http://www.datacrow.net/)
+
+It will create the md files and folder structure needed for the static version run by Hugo.
+
+Requirements:
+- php installed as cli
+- the xml export file in the import folder. Any additional files, like images go there too.
+- the import-mapping.json file in the import folder. This file defines which data goes where in the md files.
+Use the import-mapping-example.json as a base and copy it into the import folder
+- the markdown-template.md file in the import folder. This file defines the md layout.
+Use the markdown-template-example.md as a base and copy it into the import folder
+- the output folder. Created files and folder structure will be saved here and can be copied wherever you need them.
+
+import-mapping.json
+Defines which xml element from the xml export file will be used. Name of the item goes into the element entry.
+The files array defines which field of the xml element goes where in the markdown-template. Into has to start with
+file_
+Minimum is the into with an target string.
+child defines that the element has children which will be used to create a comma seperated string defined by
+valuefield.
+method defines a method in datacrowimport.class.php which will be used to alter the data befor writing it into the
+template. The string and a prefix of _modify_ will be used as the method name within the php class
+
+markdown-template.md
+The string defined in the import-mapping.json from the into field will be used in combination of # and uppercase
+as a placeholder.
+It is a ordinary markdown file which should suit your Hugo template structure. So it should match the layout of
+your final markdown file used in Hugo.
+
+Usage:
+Make sure you read the requirements and copied over the example files. Alter them to your needs.
+The run run-import-to-static-md.php file. Any error or missconfig should be printed as an error in the import-error.log
+file. After success the output folder should contain all the files you need and can be copied over to
+static-hugo content folder.
+
+    php -f run-import-to-static-md.php
diff --git a/data-crow/datacrowimport.class.php b/data-crow/datacrowimport.class.php
new file mode 100644 (file)
index 0000000..dc88257
--- /dev/null
@@ -0,0 +1,268 @@
+<?php
+/**
+ * Copyright 2019-2020 Johannes Keßler
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * read the data crow xml export and provide the information for further process
+ */
+class Datacrowimport {
+
+       private $_importFolder;
+       private $_xmlFile;
+       private $_imagesFolder;
+       private $_mappingFile = 'import-mapping.json';
+       private $_mappingData;
+       private $_entries = array();
+
+    /**
+     * setup some vars and some first checks
+     *
+     * @param $importFolder string The name of the import folder
+     * @param $xmlFile string The name of the xml export file within the import folder
+     * @param $imagesFolder mixed The name of the export images folder within the import folder. Can be false if none available
+     * @throws Exception
+     * @return void
+     */
+       public function __construct($importFolder, $xmlFile, $imagesFolder) {
+               if(file_exists($importFolder) && is_readable($importFolder)) {
+                       $this->_importFolder = $importFolder;
+                       if(DEBUG) echo "Import folder: Ok.\n";
+               }
+               else {
+                       throw new Exception('Can not find or read folder: '.var_export($importFolder,true));
+               }
+
+               if(file_exists($this->_importFolder.'/'.$xmlFile) && is_readable($this->_importFolder.'/'.$xmlFile)) {
+                       $this->_xmlFile = $this->_importFolder.'/'.$xmlFile;
+                       if(DEBUG) echo "Import XML file: Ok.\n";
+               }
+               else {
+                       throw new Exception('Can not find or read import xml file: '.var_export($importFolder.'/'.$xmlFile,true));
+               }
+
+               if(file_exists($this->_importFolder.'/'.$this->_mappingFile) && is_readable($this->_importFolder.'/'.$this->_mappingFile)) {
+               $this->_mappingData = $this->_readFieldMapping($this->_importFolder.'/'.$this->_mappingFile);
+                       if(DEBUG) echo "Import mapping file: Ok.\n";
+               }
+               else {
+                       throw new Exception('Can not find or read mapping json file: '.var_export($importFolder.'/'.$this->_mappingFile,true));
+               }
+
+               $this->_imagesFolder = false;
+               if(!empty($imagesFolder) && file_exists($this->_importFolder.'/'.$imagesFolder) && is_readable($this->_importFolder.'/'.$imagesFolder)) {
+                       $this->_imagesFolder = $this->_importFolder.'/'.$imagesFolder;
+                       if(DEBUG) echo "Images folder: Ok.\n";
+               }
+       }
+
+    /**
+     * Read the data in $this->_entries
+     */
+       public function readData() {
+
+               $xmlString = file_get_contents($this->_xmlFile);
+               if(!empty($xmlString)) {
+                       $xml = simplexml_load_string($xmlString);
+                       $elements = $xml->xpath('//'.$this->_mappingData['mapping']['element']);
+                       if(!empty($elements)) {
+                               foreach($elements as $el) {
+                                       $_data = array();
+                                       foreach($this->_mappingData['mapping']['fields'] as $key=>$field) {
+                                               if(!isset($field['into'])) continue;
+                                               $_v = '';
+
+                                               if(isset($field['child'])) {
+                                                       $entries = $el->xpath($key.'/'.$field['child'].'/'.$field['valuefield']);
+                                                       $_v = array();
+                                                       if(!empty($entries)) {
+                                                               foreach ($entries as $entry) {
+                                                                       array_push($_v, $entry[0]->__tostring());
+                                                               }
+                                                       }
+                                               }
+                                               elseif(isset($field['asset'])) {
+                                                       if(!empty($el->xpath($key))) {
+                                                               $_v = trim($el->xpath($key)[0]->__tostring());
+                                                               if (!empty($_v)) {
+                                                                       // windows stuff does not work
+                                                                       $_v = str_replace('file:///', '', $_v);
+                                                                       $_v = str_replace("\\", '/', $_v);
+                                                                       $_v = basename($_v);
+                                                                       if (!empty($this->_imagesFolder)) {
+                                                                               $_v = $this->_imagesFolder . '/' . $_v;
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                               else {
+                                                       if(isset($field['from'])) {
+                                                               $key = $field['from'];
+                                                       }
+                                                       if(!empty($el->xpath($key))) {
+                                                               $_v = trim($el->xpath($key)[0]->__tostring());
+                                                               if(isset($field['method']) && method_exists($this, '_modify_'.$field['method'])) {
+                                                                       $_m = '_modify_'.$field['method'];
+                                                                       $_v = $this->$_m($_v);
+                                                               }
+                                                       }
+                                               }
+                                               if(isset($_data[$field['into']]) && !empty($_data[$field['into']])) {
+                                                   if(is_array($_data[$field['into']])) {
+                                $_data[$field['into']][] = $this->_makeMDSave($_v);
+                            }
+                                                   else {
+                                $_data[$field['into']] = array($_data[$field['into']]);
+                                $_data[$field['into']][] = $this->_makeMDSave($_v);
+                            }
+                        }
+                                               else {
+                            $_data[$field['into']] = $this->_makeMDSave($_v);
+                        }
+                                       }
+
+                                       if(!empty($_data)) {
+                                               array_push($this->_entries, $_data);
+                                       }
+                               }
+                       }
+                       else {
+                               throw Exception('Can not find mapping element node.');
+                       }
+
+               }
+               else {
+                       throw Exception("Can not read xml file into string");
+               }
+
+       }
+
+       /**
+        * get the read entries to work with
+        * @return array
+        */
+       public function getEntries() {
+               return $this->_entries;
+       }
+
+    /**
+     * execute a curl call to the given $url
+     * @param string $url The request url
+     * @param array $data The POST data as an array
+     * @param bool $port
+     * @return bool|mixed
+     */
+    function curlPostCall($url,$data,$port=false) {
+        $ret = false;
+
+        $headers = array("Content-Type" => "multipart/form-data");
+
+        $ch = curl_init();
+
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
+        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
+        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+        curl_setopt($ch, CURLOPT_MAXREDIRS, 2);
+
+        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+        curl_setopt($ch, CURLOPT_POST,1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+
+        if(!empty($port)) {
+            curl_setopt($ch, CURLOPT_PORT, $port);
+        }
+
+        $do = curl_exec($ch);
+
+        if(is_string($do) === true) {
+            $ret = $do;
+        }
+        else {
+            error_log(var_export(curl_error($ch),true));
+        }
+
+        curl_close($ch);
+
+        return $ret;
+    }
+
+       /**
+        * Read the given mapping file
+        * @param $file
+        * @return mixed
+        * @throws Exception
+        */
+       private function _readFieldMapping($file) {
+               $contents = file_get_contents($file);
+               $contents = utf8_encode($contents);
+               $result = json_decode($contents,true);
+               if(!empty($result)) {
+                       return $result;
+               }
+               else {
+                       throw new Exception("Can not decode json file.");
+               }
+       }
+
+       /**
+        * small and simple replace to make sure we have a valid MD string
+        * @param $string
+        * @return mixed
+        */
+       private function _makeMDSave($string) {
+               $ret = str_replace('"','',$string);
+
+               return $ret;
+       }
+
+       /**
+        * _ + method attribute from json mapping will call this function
+        * with the extracted string from the source
+        * @param $string
+        * @return string
+        */
+       private function _modify_firstSentence($string) {
+               $string = trim(preg_replace('/\s+/', ' ', $string));
+               $string = preg_replace('/(.*?[?!.](?=\s|$)).*/', '\\1', $string);
+               $ret = substr($string, 0, 255);
+
+               return $ret;
+       }
+
+       /**
+        * the rating is saved with a / as a devider
+     * 5 / 10 -> 5 of 10
+        * @param $string
+        * @return mixed
+        */
+       private function _modify_modifyRating($string) {
+               $ret = str_replace("/","of",$string);
+
+               return $ret;
+       }
+
+    /**
+     * the rating is saved with a / as a devider
+     * 5 / 10 -> 5/10
+     * @param $string
+     * @return mixed
+     */
+    private function _modify_modifyRatingTrim($string) {
+        $ret = str_replace(" ","",$string);
+
+        return $ret;
+    }
+}
diff --git a/data-crow/import-mapping-example.json b/data-crow/import-mapping-example.json
new file mode 100644 (file)
index 0000000..4ff4be5
--- /dev/null
@@ -0,0 +1,69 @@
+{
+  "mapping": {
+    "element": "movie",
+    "fields": {
+      "actors": {
+        "child": "actor",
+        "valuefield": "name",
+        "into": "actors"
+      },
+      "countries-list": {
+        "into": "country"
+      },
+      "created": {
+        "into": "date"
+      },
+      "description": {
+        "into": "body"
+      },
+      "description-alternative": {
+        "into": "description",
+        "from": "description",
+        "method": "firstSentence"
+      },
+      "directors": {
+        "child": "director",
+        "valuefield": "name",
+        "into": "directors"
+      },
+      "genres": {
+        "child": "genre",
+        "valuefield": "name",
+        "into": "genres"
+      },
+      "title": {
+        "into": "title"
+      },
+      "languages-list": {
+        "into": "languages"
+      },
+      "picture-back": {
+        "into": "file_picture-back",
+        "asset": "image"
+      },
+      "picture-cd": {
+        "into": "file_picture-cd",
+        "asset": "image"
+      },
+      "picture-front": {
+        "into": "file_picture-front",
+        "asset": "image"
+      },
+      "rating": {
+        "into": "rating",
+        "method": "modifyRating"
+      },
+      "playlength": {
+        "into": "runtime"
+      },
+      "tags": {
+        "child": "tag",
+        "valuefield": "name",
+        "into": "storage"
+      },
+      "year": {
+        "into": "year"
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/data-crow/import/game/games-export.xml b/data-crow/import/game/games-export.xml
new file mode 100644 (file)
index 0000000..e8a9a08
--- /dev/null
@@ -0,0 +1,540 @@
+<?xml version="1.0" encoding="UTF-8" ?>\r
+<data-crow-objects xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="games-export.xsd">\r
+    <software-item>\r
+        <item>Software</item>\r
+        <available>true</available>\r
+        <categories>\r
+        </categories>\r
+<categories-list></categories-list>\r
+        <container>\r
+        </container>\r
+<container-list></container-list>\r
+        <cooperative-multiplayer></cooperative-multiplayer>\r
+        <countries>\r
+        </countries>\r
+<countries-list></countries-list>\r
+        <created>2015-09-23</created>\r
+        <days></days>\r
+        <days-loaned></days-loaned>\r
+        <description></description>\r
+        <developers>\r
+        </developers>\r
+<developers-list></developers-list>\r
+        <due-date></due-date>\r
+        <ean></ean>\r
+        <filehash></filehash>\r
+        <filehash-type></filehash-type>\r
+        <filename></filename>\r
+        <filesize></filesize>\r
+        <id>00a34000-fded-443f-a5bf-05df96a48f6c</id>\r
+        <item>Software</item>\r
+        <item-value></item-value>\r
+        <label>Red Ocean</label>\r
+        <languages>\r
+        </languages>\r
+<languages-list></languages-list>\r
+        <lend-by></lend-by>\r
+        <license></license>\r
+        <loan-end-date></loan-end-date>\r
+        <loan-start-date></loan-start-date>\r
+        <loan-status>Available</loan-status>\r
+        <modified>2015-09-23</modified>\r
+        <multiplayer-game></multiplayer-game>\r
+        <picture-back></picture-back>\r
+        <picture-cd></picture-cd>\r
+        <picture-front></picture-front>\r
+        <platform></platform>\r
+        <publishers>\r
+        </publishers>\r
+<publishers-list></publishers-list>\r
+        <rating></rating>\r
+        <screenshot-one></screenshot-one>\r
+        <screenshot-three></screenshot-three>\r
+        <screenshot-two></screenshot-two>\r
+        <serial-key></serial-key>\r
+        <service></service>\r
+        <service-url></service-url>\r
+        <state>\r
+        </state>\r
+<state-list></state-list>\r
+        <storage-medium></storage-medium>\r
+        <tags>\r
+            <tag>\r
+                <name>trekstor/games_1</name>\r
+            </tag>\r
+        </tags>\r
+<tags-list>trekstor/games_1</tags-list>\r
+        <title>Red Ocean</title>\r
+        <user-long-text-field></user-long-text-field>\r
+        <user-numeric-field-1></user-numeric-field-1>\r
+        <user-numeric-field-2></user-numeric-field-2>\r
+        <user-short-text-field-1></user-short-text-field-1>\r
+        <user-short-text-field-2></user-short-text-field-2>\r
+        <version></version>\r
+        <webpage></webpage>\r
+        <year></year>\r
+    </software-item>\r
+    <software-item>\r
+        <item>Software</item>\r
+        <available>true</available>\r
+        <categories>\r
+        </categories>\r
+<categories-list></categories-list>\r
+        <container>\r
+        </container>\r
+<container-list></container-list>\r
+        <cooperative-multiplayer></cooperative-multiplayer>\r
+        <countries>\r
+        </countries>\r
+<countries-list></countries-list>\r
+        <created>2015-09-23</created>\r
+        <days></days>\r
+        <days-loaned></days-loaned>\r
+        <description></description>\r
+        <developers>\r
+        </developers>\r
+<developers-list></developers-list>\r
+        <due-date></due-date>\r
+        <ean></ean>\r
+        <filehash></filehash>\r
+        <filehash-type></filehash-type>\r
+        <filename></filename>\r
+        <filesize></filesize>\r
+        <id>040ddce9-77c4-404a-b9f8-275aa46146f1</id>\r
+        <item>Software</item>\r
+        <item-value></item-value>\r
+        <label>Sins of a Solar Empire</label>\r
+        <languages>\r
+        </languages>\r
+<languages-list></languages-list>\r
+        <lend-by></lend-by>\r
+        <license></license>\r
+        <loan-end-date></loan-end-date>\r
+        <loan-start-date></loan-start-date>\r
+        <loan-status>Available</loan-status>\r
+        <modified>2015-09-23</modified>\r
+        <multiplayer-game></multiplayer-game>\r
+        <picture-back></picture-back>\r
+        <picture-cd></picture-cd>\r
+        <picture-front></picture-front>\r
+        <platform></platform>\r
+        <publishers>\r
+        </publishers>\r
+<publishers-list></publishers-list>\r
+        <rating></rating>\r
+        <screenshot-one></screenshot-one>\r
+        <screenshot-three></screenshot-three>\r
+        <screenshot-two></screenshot-two>\r
+        <serial-key></serial-key>\r
+        <service></service>\r
+        <service-url></service-url>\r
+        <state>\r
+        </state>\r
+<state-list></state-list>\r
+        <storage-medium></storage-medium>\r
+        <tags>\r
+            <tag>\r
+                <name>trekstor/games_3</name>\r
+            </tag>\r
+        </tags>\r
+<tags-list>trekstor/games_3</tags-list>\r
+        <title>Sins of a Solar Empire</title>\r
+        <user-long-text-field></user-long-text-field>\r
+        <user-numeric-field-1></user-numeric-field-1>\r
+        <user-numeric-field-2></user-numeric-field-2>\r
+        <user-short-text-field-1></user-short-text-field-1>\r
+        <user-short-text-field-2></user-short-text-field-2>\r
+        <version></version>\r
+        <webpage></webpage>\r
+        <year></year>\r
+    </software-item>\r
+    <software-item>\r
+        <item>Software</item>\r
+        <available>true</available>\r
+        <categories>\r
+        </categories>\r
+<categories-list></categories-list>\r
+        <container>\r
+        </container>\r
+<container-list></container-list>\r
+        <cooperative-multiplayer></cooperative-multiplayer>\r
+        <countries>\r
+        </countries>\r
+<countries-list></countries-list>\r
+        <created>2015-09-23</created>\r
+        <days></days>\r
+        <days-loaned></days-loaned>\r
+        <description></description>\r
+        <developers>\r
+        </developers>\r
+<developers-list></developers-list>\r
+        <due-date></due-date>\r
+        <ean></ean>\r
+        <filehash></filehash>\r
+        <filehash-type></filehash-type>\r
+        <filename></filename>\r
+        <filesize></filesize>\r
+        <id>04128f95-301c-4786-87d6-679ba7c6b9d3</id>\r
+        <item>Software</item>\r
+        <item-value></item-value>\r
+        <label>Need for Speed: Porsche Unleashed</label>\r
+        <languages>\r
+        </languages>\r
+<languages-list></languages-list>\r
+        <lend-by></lend-by>\r
+        <license></license>\r
+        <loan-end-date></loan-end-date>\r
+        <loan-start-date></loan-start-date>\r
+        <loan-status>Available</loan-status>\r
+        <modified>2015-09-23</modified>\r
+        <multiplayer-game></multiplayer-game>\r
+        <picture-back></picture-back>\r
+        <picture-cd></picture-cd>\r
+        <picture-front></picture-front>\r
+        <platform></platform>\r
+        <publishers>\r
+        </publishers>\r
+<publishers-list></publishers-list>\r
+        <rating></rating>\r
+        <screenshot-one></screenshot-one>\r
+        <screenshot-three></screenshot-three>\r
+        <screenshot-two></screenshot-two>\r
+        <serial-key></serial-key>\r
+        <service></service>\r
+        <service-url></service-url>\r
+        <state>\r
+        </state>\r
+<state-list></state-list>\r
+        <storage-medium></storage-medium>\r
+        <tags>\r
+            <tag>\r
+                <name>trekstor/games_3</name>\r
+            </tag>\r
+        </tags>\r
+<tags-list>trekstor/games_3</tags-list>\r
+        <title>Need for Speed: Porsche Unleashed</title>\r
+        <user-long-text-field></user-long-text-field>\r
+        <user-numeric-field-1></user-numeric-field-1>\r
+        <user-numeric-field-2></user-numeric-field-2>\r
+        <user-short-text-field-1></user-short-text-field-1>\r
+        <user-short-text-field-2></user-short-text-field-2>\r
+        <version></version>\r
+        <webpage></webpage>\r
+        <year></year>\r
+    </software-item>\r
+    <software-item>\r
+        <item>Software</item>\r
+        <available>true</available>\r
+        <categories>\r
+        </categories>\r
+<categories-list></categories-list>\r
+        <container>\r
+        </container>\r
+<container-list></container-list>\r
+        <cooperative-multiplayer></cooperative-multiplayer>\r
+        <countries>\r
+        </countries>\r
+<countries-list></countries-list>\r
+        <created>2015-09-23</created>\r
+        <days></days>\r
+        <days-loaned></days-loaned>\r
+        <description></description>\r
+        <developers>\r
+        </developers>\r
+<developers-list></developers-list>\r
+        <due-date></due-date>\r
+        <ean></ean>\r
+        <filehash></filehash>\r
+        <filehash-type></filehash-type>\r
+        <filename></filename>\r
+        <filesize></filesize>\r
+        <id>04136ffe-9237-4bdc-b958-90170db139db</id>\r
+        <item>Software</item>\r
+        <item-value></item-value>\r
+        <label>Need for Speed: Carbon</label>\r
+        <languages>\r
+        </languages>\r
+<languages-list></languages-list>\r
+        <lend-by></lend-by>\r
+        <license></license>\r
+        <loan-end-date></loan-end-date>\r
+        <loan-start-date></loan-start-date>\r
+        <loan-status>Available</loan-status>\r
+        <modified>2015-09-23</modified>\r
+        <multiplayer-game></multiplayer-game>\r
+        <picture-back></picture-back>\r
+        <picture-cd></picture-cd>\r
+        <picture-front></picture-front>\r
+        <platform></platform>\r
+        <publishers>\r
+        </publishers>\r
+<publishers-list></publishers-list>\r
+        <rating></rating>\r
+        <screenshot-one></screenshot-one>\r
+        <screenshot-three></screenshot-three>\r
+        <screenshot-two></screenshot-two>\r
+        <serial-key></serial-key>\r
+        <service></service>\r
+        <service-url></service-url>\r
+        <state>\r
+        </state>\r
+<state-list></state-list>\r
+        <storage-medium></storage-medium>\r
+        <tags>\r
+            <tag>\r
+                <name>trekstor/games_3</name>\r
+            </tag>\r
+        </tags>\r
+<tags-list>trekstor/games_3</tags-list>\r
+        <title>Need for Speed: Carbon</title>\r
+        <user-long-text-field></user-long-text-field>\r
+        <user-numeric-field-1></user-numeric-field-1>\r
+        <user-numeric-field-2></user-numeric-field-2>\r
+        <user-short-text-field-1></user-short-text-field-1>\r
+        <user-short-text-field-2></user-short-text-field-2>\r
+        <version></version>\r
+        <webpage></webpage>\r
+        <year></year>\r
+    </software-item>\r
+    <software-item>\r
+        <item>Software</item>\r
+        <available>true</available>\r
+        <categories>\r
+        </categories>\r
+<categories-list></categories-list>\r
+        <container>\r
+        </container>\r
+<container-list></container-list>\r
+        <cooperative-multiplayer></cooperative-multiplayer>\r
+        <countries>\r
+        </countries>\r
+<countries-list></countries-list>\r
+        <created>2015-09-23</created>\r
+        <days></days>\r
+        <days-loaned></days-loaned>\r
+        <description></description>\r
+        <developers>\r
+        </developers>\r
+<developers-list></developers-list>\r
+        <due-date></due-date>\r
+        <ean></ean>\r
+        <filehash></filehash>\r
+        <filehash-type></filehash-type>\r
+        <filename></filename>\r
+        <filesize></filesize>\r
+        <id>0436ef8a-07c0-4afd-a5d0-c640638d359f</id>\r
+        <item>Software</item>\r
+        <item-value></item-value>\r
+        <label>Turning Point: Fall of Liberty</label>\r
+        <languages>\r
+        </languages>\r
+<languages-list></languages-list>\r
+        <lend-by></lend-by>\r
+        <license></license>\r
+        <loan-end-date></loan-end-date>\r
+        <loan-start-date></loan-start-date>\r
+        <loan-status>Available</loan-status>\r
+        <modified>2015-09-23</modified>\r
+        <multiplayer-game></multiplayer-game>\r
+        <picture-back></picture-back>\r
+        <picture-cd></picture-cd>\r
+        <picture-front></picture-front>\r
+        <platform></platform>\r
+        <publishers>\r
+        </publishers>\r
+<publishers-list></publishers-list>\r
+        <rating></rating>\r
+        <screenshot-one></screenshot-one>\r
+        <screenshot-three></screenshot-three>\r
+        <screenshot-two></screenshot-two>\r
+        <serial-key></serial-key>\r
+        <service></service>\r
+        <service-url></service-url>\r
+        <state>\r
+        </state>\r
+<state-list></state-list>\r
+        <storage-medium></storage-medium>\r
+        <tags>\r
+            <tag>\r
+                <name>trekstor/games_3</name>\r
+            </tag>\r
+        </tags>\r
+<tags-list>trekstor/games_3</tags-list>\r
+        <title>Turning Point: Fall of Liberty</title>\r
+        <user-long-text-field></user-long-text-field>\r
+        <user-numeric-field-1></user-numeric-field-1>\r
+        <user-numeric-field-2></user-numeric-field-2>\r
+        <user-short-text-field-1></user-short-text-field-1>\r
+        <user-short-text-field-2></user-short-text-field-2>\r
+        <version></version>\r
+        <webpage></webpage>\r
+        <year></year>\r
+    </software-item>\r
+    <software-item>\r
+        <item>Software</item>\r
+        <available>true</available>\r
+        <categories>\r
+            <category>\r
+                <name>Racing</name>\r
+            </category>\r
+        </categories>\r
+<categories-list>Racing</categories-list>\r
+        <container>\r
+        </container>\r
+<container-list></container-list>\r
+        <cooperative-multiplayer>false</cooperative-multiplayer>\r
+        <countries>\r
+        </countries>\r
+<countries-list></countries-list>\r
+        <created>2015-12-06</created>\r
+        <days></days>\r
+        <days-loaned></days-loaned>\r
+        <description>This Digital Edition is the download release of the game. It contains:\r
+Project CARS\r
+Limited Edition Car Pack with five new cars:\r
+BMW M1 Pro Car\r
+Ford GT40 Mk IV\r
+McLaren F1\r
+Mercedes-Benz AMG C-Coupe DTM\r
+Sauber C9When pre-ordered it also contained The Modified Car Pack with three additional cars:\r
+Ariel Atom 3 Mugen\r
+Pagani Zonda Cinque Roadster\r
+Ruf CTR3 SMS-R</description>\r
+        <developers>\r
+            <developer>\r
+                <name>Slightly Mad Studios Limited</name>\r
+            </developer>\r
+        </developers>\r
+<developers-list>Slightly Mad Studios Limited</developers-list>\r
+        <due-date></due-date>\r
+        <ean></ean>\r
+        <filehash></filehash>\r
+        <filehash-type></filehash-type>\r
+        <filename></filename>\r
+        <filesize></filesize>\r
+        <id>04b34ba9-6ae3-4aae-b752-9377e6da7dee</id>\r
+        <item>Software</item>\r
+        <item-value></item-value>\r
+        <label>Project CARS (Digital Edition) for Windows (2015)</label>\r
+        <languages>\r
+        </languages>\r
+<languages-list></languages-list>\r
+        <lend-by></lend-by>\r
+        <license></license>\r
+        <loan-end-date></loan-end-date>\r
+        <loan-start-date></loan-start-date>\r
+        <loan-status>Available</loan-status>\r
+        <modified>2018-01-06</modified>\r
+        <multiplayer-game>false</multiplayer-game>\r
+        <picture-back></picture-back>\r
+        <picture-cd></picture-cd>\r
+        <picture-front>file:///F:\Documents\tmp\games-export_images\04b34ba9-6ae3-4aae-b752-9377e6da7dee_PictureFront.jpg</picture-front>\r
+        <platform>PC</platform>\r
+        <publishers>\r
+            <publisher>\r
+                <name>BANDAI NAMCO Entertainment Europe S.A.S.</name>\r
+            </publisher>\r
+        </publishers>\r
+<publishers-list>BANDAI NAMCO Entertainment Europe S.A.S.</publishers-list>\r
+        <rating></rating>\r
+        <screenshot-one></screenshot-one>\r
+        <screenshot-three></screenshot-three>\r
+        <screenshot-two></screenshot-two>\r
+        <serial-key></serial-key>\r
+        <service>MobyGames / none / none / value=[Project Cars]</service>\r
+        <service-url>http://www.mobygames.com/game/windows/project-cars-digital-edition</service-url>\r
+        <state>\r
+        </state>\r
+<state-list></state-list>\r
+        <storage-medium></storage-medium>\r
+        <tags>\r
+            <tag>\r
+                <name>Storage C</name>\r
+            </tag>\r
+        </tags>\r
+<tags-list>Storage C</tags-list>\r
+        <title>Project CARS (Digital Edition) for Windows (2015)</title>\r
+        <user-long-text-field></user-long-text-field>\r
+        <user-numeric-field-1></user-numeric-field-1>\r
+        <user-numeric-field-2></user-numeric-field-2>\r
+        <user-short-text-field-1></user-short-text-field-1>\r
+        <user-short-text-field-2></user-short-text-field-2>\r
+        <version></version>\r
+        <webpage>http://www.mobygames.com/game/windows/project-cars-digital-edition</webpage>\r
+        <year>2015</year>\r
+    </software-item>\r
+    <software-item>\r
+        <item>Software</item>\r
+        <available>true</available>\r
+        <categories>\r
+        </categories>\r
+<categories-list></categories-list>\r
+        <container>\r
+        </container>\r
+<container-list></container-list>\r
+        <cooperative-multiplayer></cooperative-multiplayer>\r
+        <countries>\r
+        </countries>\r
+<countries-list></countries-list>\r
+        <created>2015-09-23</created>\r
+        <days></days>\r
+        <days-loaned></days-loaned>\r
+        <description></description>\r
+        <developers>\r
+        </developers>\r
+<developers-list></developers-list>\r
+        <due-date></due-date>\r
+        <ean></ean>\r
+        <filehash></filehash>\r
+        <filehash-type></filehash-type>\r
+        <filename></filename>\r
+        <filesize></filesize>\r
+        <id>05b574c1-d11c-48e9-8633-a32ea3b7460d</id>\r
+        <item>Software</item>\r
+        <item-value></item-value>\r
+        <label>Messiah</label>\r
+        <languages>\r
+        </languages>\r
+<languages-list></languages-list>\r
+        <lend-by></lend-by>\r
+        <license></license>\r
+        <loan-end-date></loan-end-date>\r
+        <loan-start-date></loan-start-date>\r
+        <loan-status>Available</loan-status>\r
+        <modified>2015-09-23</modified>\r
+        <multiplayer-game></multiplayer-game>\r
+        <picture-back></picture-back>\r
+        <picture-cd></picture-cd>\r
+        <picture-front></picture-front>\r
+        <platform></platform>\r
+        <publishers>\r
+        </publishers>\r
+<publishers-list></publishers-list>\r
+        <rating></rating>\r
+        <screenshot-one></screenshot-one>\r
+        <screenshot-three></screenshot-three>\r
+        <screenshot-two></screenshot-two>\r
+        <serial-key></serial-key>\r
+        <service></service>\r
+        <service-url></service-url>\r
+        <state>\r
+        </state>\r
+<state-list></state-list>\r
+        <storage-medium></storage-medium>\r
+        <tags>\r
+            <tag>\r
+                <name>trekstor/games_3</name>\r
+            </tag>\r
+        </tags>\r
+<tags-list>trekstor/games_3</tags-list>\r
+        <title>Messiah</title>\r
+        <user-long-text-field></user-long-text-field>\r
+        <user-numeric-field-1></user-numeric-field-1>\r
+        <user-numeric-field-2></user-numeric-field-2>\r
+        <user-short-text-field-1></user-short-text-field-1>\r
+        <user-short-text-field-2></user-short-text-field-2>\r
+        <version></version>\r
+        <webpage></webpage>\r
+        <year></year>\r
+    </software-item>\r
+</data-crow-objects>\r
diff --git a/data-crow/import/game/games-export.xsd b/data-crow/import/game/games-export.xsd
new file mode 100644 (file)
index 0000000..55cca0a
--- /dev/null
@@ -0,0 +1,243 @@
+<?xml version="1.0"?>\r
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">\r
+    <xsd:element name="data-crow-objects">\r
+    <xsd:complexType>\r
+        <xsd:sequence>\r
+            <xsd:element maxOccurs="unbounded" ref="software-item"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+</xsd:element>\r
+\r
+    <xsd:element name="category" type="type-category"/>\r
+    <xsd:complexType name="type-category">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="container" type="type-container"/>\r
+    <xsd:complexType name="type-container">\r
+        <xsd:sequence>\r
+            <xsd:element name="item" type="xsd:string"/>\r
+            <xsd:element name="available" type="xsd:boolean"/>\r
+            <xsd:element name="parent" type="xsd:string"/>\r
+            <xsd:element name="created" type="xsd:date"/>\r
+            <xsd:element name="days" type="xsd:integer"/>\r
+            <xsd:element name="days-loaned" type="xsd:integer"/>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+            <xsd:element name="due-date" type="xsd:date"/>\r
+            <xsd:element name="filehash" type="xsd:string"/>\r
+            <xsd:element name="filehash-type" type="xsd:string"/>\r
+            <xsd:element name="filename" type="xsd:string"/>\r
+            <xsd:element name="filesize" type="xsd:integer"/>\r
+            <xsd:element name="id" type="xsd:string"/>\r
+            <xsd:element name="item" type="xsd:string"/>\r
+            <xsd:element name="label" type="xsd:string"/>\r
+            <xsd:element name="lend-by" type="xsd:string"/>\r
+            <xsd:element name="loan-end-date" type="xsd:date"/>\r
+            <xsd:element name="loan-start-date" type="xsd:date"/>\r
+            <xsd:element name="loan-status" type="xsd:string"/>\r
+            <xsd:element name="modified" type="xsd:date"/>\r
+            <xsd:element name="picture-front" type="xsd:string"/>\r
+            <xsd:element name="container-type" type="xsd:string"/>\r
+            <xsd:element name="tags"/>\r
+            <xsd:element name="tags-list" type="xsd:string"/>\r
+            <xsd:element name="user-long-text-field" type="xsd:string"/>\r
+            <xsd:element name="user-numeric-field-1" type="xsd:integer"/>\r
+            <xsd:element name="user-numeric-field-2" type="xsd:integer"/>\r
+            <xsd:element name="user-short-text-field-1" type="xsd:string"/>\r
+            <xsd:element name="user-short-text-field-2" type="xsd:string"/>\r
+            <xsd:element name="description" type="xsd:string"/>\r
+            <xsd:element name="items"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="country" type="type-country"/>\r
+    <xsd:complexType name="type-country">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="developer" type="type-developer"/>\r
+    <xsd:complexType name="type-developer">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="language" type="type-language"/>\r
+    <xsd:complexType name="type-language">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="publisher" type="type-publisher"/>\r
+    <xsd:complexType name="type-publisher">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="state" type="type-state"/>\r
+    <xsd:complexType name="type-state">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="tag" type="type-tag"/>\r
+    <xsd:complexType name="type-tag">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="software-item" type="type-software-item"/>\r
+    <xsd:complexType name="type-software-item">\r
+        <xsd:sequence>\r
+            <xsd:element name="item" type="xsd:string"/>\r
+            <xsd:element name="available" type="xsd:boolean"/>\r
+            <xsd:element name="categories"/>\r
+            <xsd:element name="categories-list" type="xsd:string"/>\r
+            <xsd:element name="container"/>\r
+            <xsd:element name="container-list" type="xsd:string"/>\r
+            <xsd:element name="cooperative-multiplayer" type="xsd:boolean"/>\r
+            <xsd:element name="countries"/>\r
+            <xsd:element name="countries-list" type="xsd:string"/>\r
+            <xsd:element name="created" type="xsd:date"/>\r
+            <xsd:element name="days" type="xsd:integer"/>\r
+            <xsd:element name="days-loaned" type="xsd:integer"/>\r
+            <xsd:element name="description" type="xsd:string"/>\r
+            <xsd:element name="developers"/>\r
+            <xsd:element name="developers-list" type="xsd:string"/>\r
+            <xsd:element name="due-date" type="xsd:date"/>\r
+            <xsd:element name="ean" type="xsd:string"/>\r
+            <xsd:element name="filehash" type="xsd:string"/>\r
+            <xsd:element name="filehash-type" type="xsd:string"/>\r
+            <xsd:element name="filename" type="xsd:string"/>\r
+            <xsd:element name="filesize" type="xsd:integer"/>\r
+            <xsd:element name="id" type="xsd:string"/>\r
+            <xsd:element name="item" type="xsd:string"/>\r
+            <xsd:element name="item-value" type="xsd:string"/>\r
+            <xsd:element name="label" type="xsd:string"/>\r
+            <xsd:element name="languages"/>\r
+            <xsd:element name="languages-list" type="xsd:string"/>\r
+            <xsd:element name="lend-by" type="xsd:string"/>\r
+            <xsd:element name="license" type="xsd:string"/>\r
+            <xsd:element name="loan-end-date" type="xsd:date"/>\r
+            <xsd:element name="loan-start-date" type="xsd:date"/>\r
+            <xsd:element name="loan-status" type="xsd:string"/>\r
+            <xsd:element name="modified" type="xsd:date"/>\r
+            <xsd:element name="multiplayer-game" type="xsd:boolean"/>\r
+            <xsd:element name="picture-back" type="xsd:string"/>\r
+            <xsd:element name="picture-cd" type="xsd:string"/>\r
+            <xsd:element name="picture-front" type="xsd:string"/>\r
+            <xsd:element name="platform" type="xsd:string"/>\r
+            <xsd:element name="publishers"/>\r
+            <xsd:element name="publishers-list" type="xsd:string"/>\r
+            <xsd:element name="rating" type="xsd:integer"/>\r
+            <xsd:element name="screenshot-one" type="xsd:string"/>\r
+            <xsd:element name="screenshot-three" type="xsd:string"/>\r
+            <xsd:element name="screenshot-two" type="xsd:string"/>\r
+            <xsd:element name="serial-key" type="xsd:string"/>\r
+            <xsd:element name="service" type="xsd:string"/>\r
+            <xsd:element name="service-url" type="xsd:string"/>\r
+            <xsd:element name="state"/>\r
+            <xsd:element name="state-list" type="xsd:string"/>\r
+            <xsd:element name="storage-medium" type="xsd:string"/>\r
+            <xsd:element name="tags"/>\r
+            <xsd:element name="tags-list" type="xsd:string"/>\r
+            <xsd:element name="title" type="xsd:string"/>\r
+            <xsd:element name="user-long-text-field" type="xsd:string"/>\r
+            <xsd:element name="user-numeric-field-1" type="xsd:integer"/>\r
+            <xsd:element name="user-numeric-field-2" type="xsd:integer"/>\r
+            <xsd:element name="user-short-text-field-1" type="xsd:string"/>\r
+            <xsd:element name="user-short-text-field-2" type="xsd:string"/>\r
+            <xsd:element name="version" type="xsd:string"/>\r
+            <xsd:element name="webpage" type="xsd:string"/>\r
+            <xsd:element name="year" type="xsd:integer"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+    <xsd:element name="tags">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="tag"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="items">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="item"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="categories">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="category"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="container">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="container"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="countries">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="country"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="developers">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="developer"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="languages">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="language"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="publishers">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="publisher"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="state">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="state"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+</xsd:schema>\r
diff --git a/data-crow/import/game/games-export_images/04b34ba9-6ae3-4aae-b752-9377e6da7dee_PictureFront.jpg b/data-crow/import/game/games-export_images/04b34ba9-6ae3-4aae-b752-9377e6da7dee_PictureFront.jpg
new file mode 100644 (file)
index 0000000..307b61d
Binary files /dev/null and b/data-crow/import/game/games-export_images/04b34ba9-6ae3-4aae-b752-9377e6da7dee_PictureFront.jpg differ
diff --git a/data-crow/import/game/import-mapping.json b/data-crow/import/game/import-mapping.json
new file mode 100644 (file)
index 0000000..311a408
--- /dev/null
@@ -0,0 +1,75 @@
+{
+  "mapping": {
+    "element": "software-item",
+    "fields": {
+      "categories": {
+        "child": "category",
+        "valuefield": "name",
+        "into": "category"
+      },
+      "description": {
+        "into": "description"
+      },
+      "developers": {
+        "child": "developer",
+        "valuefield": "name",
+        "into": "directors"
+      },
+
+
+      "countries-list": {
+        "into": "country"
+      },
+      "created": {
+        "into": "date"
+      },
+      "description": {
+        "into": "body"
+      },
+      "description-alternative": {
+        "into": "description",
+        "from": "description",
+        "method": "firstSentence"
+      },
+
+      "genres": {
+        "child": "genre",
+        "valuefield": "name",
+        "into": "genres"
+      },
+      "title": {
+        "into": "title"
+      },
+      "languages-list": {
+        "into": "languages"
+      },
+      "picture-back": {
+        "into": "file_picture-back",
+        "asset": "image"
+      },
+      "picture-cd": {
+        "into": "file_picture-cd",
+        "asset": "image"
+      },
+      "picture-front": {
+        "into": "file_picture-front",
+        "asset": "image"
+      },
+      "rating": {
+        "into": "rating",
+        "method": "modifyRating"
+      },
+      "playlength": {
+        "into": "runtime"
+      },
+      "tags": {
+        "child": "tag",
+        "valuefield": "name",
+        "into": "storage"
+      },
+      "year": {
+        "into": "year"
+      }
+    }
+  }
+}
diff --git a/data-crow/import/movie/import-mapping.json b/data-crow/import/movie/import-mapping.json
new file mode 100644 (file)
index 0000000..55ef280
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "mapping": {
+    "element": "movie",
+    "fields": {
+      "actors": {
+        "child": "actor",
+        "valuefield": "name",
+        "into": "actors"
+      },
+      "countries": {
+        "child": "country",
+        "valuefield": "name",
+        "into": "countries"
+      },
+      "description": {
+        "into": "content"
+      },
+      "description-alternative": {
+        "into": "description",
+        "from": "description",
+        "method": "firstSentence"
+      },
+      "directors": {
+        "child": "director",
+        "valuefield": "name",
+        "into": "directors"
+      },
+      "genres": {
+        "child": "genre",
+        "valuefield": "name",
+        "into": "genres"
+      },
+      "title": {
+        "into": "title"
+      },
+      "languages": {
+        "child": "language",
+        "valuefield": "name",
+        "into": "languages"
+      },
+      "picture-back": {
+        "into": "attachment",
+        "asset": "image"
+      },
+      "picture-cd": {
+        "into": "attachment",
+        "asset": "image"
+      },
+      "picture-front": {
+        "into": "coverimage",
+        "asset": "image"
+      },
+      "rating": {
+        "into": "rating",
+        "method": "modifyRatingTrim"
+      },
+      "playlength": {
+        "into": "runtime"
+      },
+      "tags": {
+        "child": "tag",
+        "valuefield": "name",
+        "into": "tag"
+      },
+      "year": {
+        "into": "year"
+      }
+    }
+  }
+}
diff --git a/data-crow/import/movie/movies-export.xml b/data-crow/import/movie/movies-export.xml
new file mode 100644 (file)
index 0000000..298ff41
--- /dev/null
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8" ?>\r
+<data-crow-objects xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="movies-export.xsd">\r
+    <movie>\r
+        <item>Movies</item>\r
+        <actors>\r
+            <actor>\r
+                <name>Amber Heard</name>\r
+            </actor>\r
+            <actor>\r
+                <name>Gary Oldman</name>\r
+            </actor>\r
+            <actor>\r
+                <name>Harrison Ford</name>\r
+            </actor>\r
+            <actor>\r
+                <name>Liam Hemsworth</name>\r
+            </actor>\r
+        </actors>\r
+<actors-list>Amber Heard, Gary Oldman, Harrison Ford, Liam Hemsworth</actors-list>\r
+        <aspect-ratio></aspect-ratio>\r
+        <audio-bitrate></audio-bitrate>\r
+        <audio-channels></audio-channels>\r
+        <audio-codec></audio-codec>\r
+        <audio-languages>\r
+        </audio-languages>\r
+<audio-languages-list></audio-languages-list>\r
+        <audio-sample-rate></audio-sample-rate>\r
+        <available>true</available>\r
+        <certification>PG-13</certification>\r
+        <color></color>\r
+        <container>\r
+        </container>\r
+<container-list></container-list>\r
+        <countries>\r
+            <country>\r
+                <name>France</name>\r
+            </country>\r
+            <country>\r
+                <name>United States</name>\r
+            </country>\r
+        </countries>\r
+<countries-list>France, United States</countries-list>\r
+        <created>2015-09-22</created>\r
+        <days></days>\r
+        <days-loaned></days-loaned>\r
+        <description>The high stakes thriller Paranoia takes us deep behind the scenes of global success to a deadly world of greed and deception. The two most powerful tech billionaires in the world (Harrison Ford and Gary Oldman) are bitter rivals with a complicated past who will stop at nothing to destroy each other. A young superstar (Liam Hemsworth), seduced by unlimited wealth and power falls between them, and becomes trapped in the middle of the twists and turns of their life-and-death game of corporate espionage. By the time he realizes his life is in danger, he is in far too deep and knows far too much for them to let him walk away.</description>\r
+        <directors>\r
+            <director>\r
+                <name>Robert Luketic</name>\r
+            </director>\r
+        </directors>\r
+<directors-list>Robert Luketic</directors-list>\r
+        <due-date></due-date>\r
+        <ean></ean>\r
+        <episode-nr></episode-nr>\r
+        <episode-name></episode-name>\r
+        <filehash></filehash>\r
+        <filehash-type></filehash-type>\r
+        <filename></filename>\r
+        <filesize></filesize>\r
+        <fps></fps>\r
+        <frames></frames>\r
+        <genres>\r
+            <genre>\r
+                <name>Drama</name>\r
+            </genre>\r
+            <genre>\r
+                <name>Thriller</name>\r
+            </genre>\r
+        </genres>\r
+<genres-list>Drama, Thriller</genres-list>\r
+        <height></height>\r
+        <id>00330b7f-5df8-49fa-ad79-2d1eb8ebb38c</id>\r
+        <item>Movies</item>\r
+        <item-value></item-value>\r
+        <label>Paranoia</label>\r
+        <languages>\r
+            <language>\r
+                <name>English</name>\r
+            </language>\r
+        </languages>\r
+<languages-list>English</languages-list>\r
+        <lend-by></lend-by>\r
+        <loan-end-date></loan-end-date>\r
+        <loan-start-date></loan-start-date>\r
+        <loan-status>Available</loan-status>\r
+        <modified>2015-09-23</modified>\r
+        <picture-back>file:///F:\Documents\tmp\movies-export_images\0efb720d-d9e5-406b-aa42-e356f9c544e9_PictureFront.jpg</picture-back>\r
+        <picture-cd>file:///F:\Documents\tmp\movies-export_images\3edf49eb-0270-456d-a15d-e5ddcba302ed_PictureFront.jpg</picture-cd>\r
+        <picture-front>file:///F:\Documents\tmp\movies-export_images\00330b7f-5df8-49fa-ad79-2d1eb8ebb38c_PictureFront.jpg</picture-front>\r
+        <playlength></playlength>\r
+        <rating>6 / 10</rating>\r
+        <season></season>\r
+        <series></series>\r
+        <service>Imdb / us / none / value=[Paranoia]</service>\r
+        <service-url>http://us.imdb.com/title/tt1413495</service-url>\r
+        <state></state>\r
+        <storage-medium></storage-medium>\r
+        <subtitle-languages>\r
+        </subtitle-languages>\r
+<subtitle-languages-list></subtitle-languages-list>\r
+        <tags>\r
+            <tag>\r
+                <name>Storage B</name>\r
+            </tag>\r
+        </tags>\r
+<tags-list>Storage B</tags-list>\r
+        <title>Paranoia</title>\r
+        <title-local></title-local>\r
+        <user-long-text-field></user-long-text-field>\r
+        <user-numeric-field-1></user-numeric-field-1>\r
+        <user-numeric-field-2></user-numeric-field-2>\r
+        <user-short-text-field-1></user-short-text-field-1>\r
+        <user-short-text-field-2></user-short-text-field-2>\r
+        <video-bitrate></video-bitrate>\r
+        <video-codec></video-codec>\r
+        <webpage>http://us.imdb.com/title/tt1413495</webpage>\r
+        <width></width>\r
+        <year>2013</year>\r
+    </movie>\r
+    <movie>\r
+        <item>Movies</item>\r
+        <actors>\r
+            <actor>\r
+                <name>Camryn Manheim</name>\r
+            </actor>\r
+            <actor>\r
+                <name>Hays Wellford</name>\r
+            </actor>\r
+            <actor>\r
+                <name>James Freedson-Jackson</name>\r
+            </actor>\r
+            <actor>\r
+                <name>Kevin Bacon</name>\r
+            </actor>\r
+        </actors>\r
+<actors-list>Camryn Manheim, Hays Wellford, James Freedson-Jackson, Kevin Bacon</actors-list>\r
+        <aspect-ratio></aspect-ratio>\r
+        <audio-bitrate></audio-bitrate>\r
+        <audio-channels></audio-channels>\r
+        <audio-codec></audio-codec>\r
+        <audio-languages>\r
+        </audio-languages>\r
+<audio-languages-list></audio-languages-list>\r
+        <audio-sample-rate></audio-sample-rate>\r
+        <available>true</available>\r
+        <certification>R</certification>\r
+        <color></color>\r
+        <container>\r
+        </container>\r
+<container-list></container-list>\r
+        <countries>\r
+        </countries>\r
+<countries-list></countries-list>\r
+        <created>2016-03-13</created>\r
+        <days></days>\r
+        <days-loaned></days-loaned>\r
+        <description>A pair of ten-year-olds find an abandoned cop car in a field. When they take it for a joyride, it seems like they could kill themselves at any moment. But things only get worse when the small town sheriff goes looking for his missing car. The kids find themselves in the center of a deadly game of cat and mouse they don&apos;t understand and the only way out is to go as fast as their cop car can take them.</description>\r
+        <directors>\r
+            <director>\r
+                <name>Jon Watts</name>\r
+            </director>\r
+        </directors>\r
+<directors-list>Jon Watts</directors-list>\r
+        <due-date></due-date>\r
+        <ean></ean>\r
+        <episode-nr></episode-nr>\r
+        <episode-name></episode-name>\r
+        <filehash></filehash>\r
+        <filehash-type></filehash-type>\r
+        <filename></filename>\r
+        <filesize></filesize>\r
+        <fps></fps>\r
+        <frames></frames>\r
+        <genres>\r
+            <genre>\r
+                <name>Thriller</name>\r
+            </genre>\r
+        </genres>\r
+<genres-list>Thriller</genres-list>\r
+        <height></height>\r
+        <id>a5c41732-a600-405e-bab4-c3fa24745277</id>\r
+        <item>Movies</item>\r
+        <item-value></item-value>\r
+        <label>Cop Car</label>\r
+        <languages>\r
+        </languages>\r
+<languages-list></languages-list>\r
+        <lend-by></lend-by>\r
+        <loan-end-date></loan-end-date>\r
+        <loan-start-date></loan-start-date>\r
+        <loan-status>Available</loan-status>\r
+        <modified>2016-03-13</modified>\r
+        <picture-back></picture-back>\r
+        <picture-cd></picture-cd>\r
+        <picture-front>file:///F:\Documents\tmp\movies-export_images\a5c41732-a600-405e-bab4-c3fa24745277_PictureFront.jpg</picture-front>\r
+        <playlength></playlength>\r
+        <rating>6 / 10</rating>\r
+        <season></season>\r
+        <series></series>\r
+        <service>Imdb / us / none / value=[cop car]</service>\r
+        <service-url>http://us.imdb.com/title/tt3813310</service-url>\r
+        <state></state>\r
+        <storage-medium></storage-medium>\r
+        <subtitle-languages>\r
+        </subtitle-languages>\r
+<subtitle-languages-list></subtitle-languages-list>\r
+        <tags>\r
+            <tag>\r
+                <name>Storage C</name>\r
+            </tag>\r
+        </tags>\r
+<tags-list>Storage C</tags-list>\r
+        <title>Cop Car</title>\r
+        <title-local></title-local>\r
+        <user-long-text-field></user-long-text-field>\r
+        <user-numeric-field-1></user-numeric-field-1>\r
+        <user-numeric-field-2></user-numeric-field-2>\r
+        <user-short-text-field-1></user-short-text-field-1>\r
+        <user-short-text-field-2></user-short-text-field-2>\r
+        <video-bitrate></video-bitrate>\r
+        <video-codec></video-codec>\r
+        <webpage>http://us.imdb.com/title/tt3813310</webpage>\r
+        <width></width>\r
+        <year>2015</year>\r
+    </movie>\r
+</data-crow-objects>\r
diff --git a/data-crow/import/movie/movies-export.xsd b/data-crow/import/movie/movies-export.xsd
new file mode 100644 (file)
index 0000000..cfd7dbf
--- /dev/null
@@ -0,0 +1,256 @@
+<?xml version="1.0"?>\r
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">\r
+    <xsd:element name="data-crow-objects">\r
+    <xsd:complexType>\r
+        <xsd:sequence>\r
+            <xsd:element maxOccurs="unbounded" ref="movie"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+</xsd:element>\r
+\r
+    <xsd:element name="actor" type="type-actor"/>\r
+    <xsd:complexType name="type-actor">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="language" type="type-language"/>\r
+    <xsd:complexType name="type-language">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="container" type="type-container"/>\r
+    <xsd:complexType name="type-container">\r
+        <xsd:sequence>\r
+            <xsd:element name="item" type="xsd:string"/>\r
+            <xsd:element name="description" type="xsd:string"/>\r
+            <xsd:element name="available" type="xsd:boolean"/>\r
+            <xsd:element name="created" type="xsd:date"/>\r
+            <xsd:element name="days" type="xsd:integer"/>\r
+            <xsd:element name="days-loaned" type="xsd:integer"/>\r
+            <xsd:element name="icon" type="xsd:string"/>\r
+            <xsd:element name="due-date" type="xsd:date"/>\r
+            <xsd:element name="filehash" type="xsd:string"/>\r
+            <xsd:element name="filehash-type" type="xsd:string"/>\r
+            <xsd:element name="filename" type="xsd:string"/>\r
+            <xsd:element name="filesize" type="xsd:integer"/>\r
+            <xsd:element name="picture-front" type="xsd:string"/>\r
+            <xsd:element name="id" type="xsd:string"/>\r
+            <xsd:element name="item" type="xsd:string"/>\r
+            <xsd:element name="label" type="xsd:string"/>\r
+            <xsd:element name="lend-by" type="xsd:string"/>\r
+            <xsd:element name="loan-end-date" type="xsd:date"/>\r
+            <xsd:element name="loan-start-date" type="xsd:date"/>\r
+            <xsd:element name="loan-status" type="xsd:string"/>\r
+            <xsd:element name="modified" type="xsd:date"/>\r
+            <xsd:element name="tags"/>\r
+            <xsd:element name="tags-list" type="xsd:string"/>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+            <xsd:element name="user-long-text-field" type="xsd:string"/>\r
+            <xsd:element name="user-numeric-field-1" type="xsd:integer"/>\r
+            <xsd:element name="user-numeric-field-2" type="xsd:integer"/>\r
+            <xsd:element name="user-short-text-field-1" type="xsd:string"/>\r
+            <xsd:element name="user-short-text-field-2" type="xsd:string"/>\r
+            <xsd:element name="container-type" type="xsd:string"/>\r
+            <xsd:element name="items"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="country" type="type-country"/>\r
+    <xsd:complexType name="type-country">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="director" type="type-director"/>\r
+    <xsd:complexType name="type-director">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="genre" type="type-genre"/>\r
+    <xsd:complexType name="type-genre">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="tag" type="type-tag"/>\r
+    <xsd:complexType name="type-tag">\r
+        <xsd:sequence>\r
+            <xsd:element name="name" type="xsd:string"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+\r
+    <xsd:element name="movie" type="type-movie"/>\r
+    <xsd:complexType name="type-movie">\r
+        <xsd:sequence>\r
+            <xsd:element name="item" type="xsd:string"/>\r
+            <xsd:element name="actors"/>\r
+            <xsd:element name="actors-list" type="xsd:string"/>\r
+            <xsd:element name="aspect-ratio" type="xsd:string"/>\r
+            <xsd:element name="audio-bitrate" type="xsd:string"/>\r
+            <xsd:element name="audio-channels" type="xsd:string"/>\r
+            <xsd:element name="audio-codec" type="xsd:string"/>\r
+            <xsd:element name="audio-languages"/>\r
+            <xsd:element name="audio-languages-list" type="xsd:string"/>\r
+            <xsd:element name="audio-sample-rate" type="xsd:string"/>\r
+            <xsd:element name="available" type="xsd:boolean"/>\r
+            <xsd:element name="certification" type="xsd:string"/>\r
+            <xsd:element name="color" type="xsd:string"/>\r
+            <xsd:element name="container"/>\r
+            <xsd:element name="container-list" type="xsd:string"/>\r
+            <xsd:element name="countries"/>\r
+            <xsd:element name="countries-list" type="xsd:string"/>\r
+            <xsd:element name="created" type="xsd:date"/>\r
+            <xsd:element name="days" type="xsd:integer"/>\r
+            <xsd:element name="days-loaned" type="xsd:integer"/>\r
+            <xsd:element name="description" type="xsd:string"/>\r
+            <xsd:element name="directors"/>\r
+            <xsd:element name="directors-list" type="xsd:string"/>\r
+            <xsd:element name="due-date" type="xsd:date"/>\r
+            <xsd:element name="ean" type="xsd:string"/>\r
+            <xsd:element name="episode-nr" type="xsd:integer"/>\r
+            <xsd:element name="episode-name" type="xsd:string"/>\r
+            <xsd:element name="filehash" type="xsd:string"/>\r
+            <xsd:element name="filehash-type" type="xsd:string"/>\r
+            <xsd:element name="filename" type="xsd:string"/>\r
+            <xsd:element name="filesize" type="xsd:integer"/>\r
+            <xsd:element name="fps" type="xsd:string"/>\r
+            <xsd:element name="frames" type="xsd:string"/>\r
+            <xsd:element name="genres"/>\r
+            <xsd:element name="genres-list" type="xsd:string"/>\r
+            <xsd:element name="height" type="xsd:string"/>\r
+            <xsd:element name="id" type="xsd:string"/>\r
+            <xsd:element name="item" type="xsd:string"/>\r
+            <xsd:element name="item-value" type="xsd:string"/>\r
+            <xsd:element name="label" type="xsd:string"/>\r
+            <xsd:element name="languages"/>\r
+            <xsd:element name="languages-list" type="xsd:string"/>\r
+            <xsd:element name="lend-by" type="xsd:string"/>\r
+            <xsd:element name="loan-end-date" type="xsd:date"/>\r
+            <xsd:element name="loan-start-date" type="xsd:date"/>\r
+            <xsd:element name="loan-status" type="xsd:string"/>\r
+            <xsd:element name="modified" type="xsd:date"/>\r
+            <xsd:element name="picture-back" type="xsd:string"/>\r
+            <xsd:element name="picture-cd" type="xsd:string"/>\r
+            <xsd:element name="picture-front" type="xsd:string"/>\r
+            <xsd:element name="playlength" type="xsd:integer"/>\r
+            <xsd:element name="rating" type="xsd:integer"/>\r
+            <xsd:element name="season" type="xsd:string"/>\r
+            <xsd:element name="series" type="xsd:string"/>\r
+            <xsd:element name="service" type="xsd:string"/>\r
+            <xsd:element name="service-url" type="xsd:string"/>\r
+            <xsd:element name="state" type="xsd:string"/>\r
+            <xsd:element name="storage-medium" type="xsd:string"/>\r
+            <xsd:element name="subtitle-languages"/>\r
+            <xsd:element name="subtitle-languages-list" type="xsd:string"/>\r
+            <xsd:element name="tags"/>\r
+            <xsd:element name="tags-list" type="xsd:string"/>\r
+            <xsd:element name="title" type="xsd:string"/>\r
+            <xsd:element name="title-local" type="xsd:string"/>\r
+            <xsd:element name="user-long-text-field" type="xsd:string"/>\r
+            <xsd:element name="user-numeric-field-1" type="xsd:integer"/>\r
+            <xsd:element name="user-numeric-field-2" type="xsd:integer"/>\r
+            <xsd:element name="user-short-text-field-1" type="xsd:string"/>\r
+            <xsd:element name="user-short-text-field-2" type="xsd:string"/>\r
+            <xsd:element name="video-bitrate" type="xsd:string"/>\r
+            <xsd:element name="video-codec" type="xsd:string"/>\r
+            <xsd:element name="webpage" type="xsd:string"/>\r
+            <xsd:element name="width" type="xsd:string"/>\r
+            <xsd:element name="year" type="xsd:integer"/>\r
+        </xsd:sequence>\r
+    </xsd:complexType>\r
+\r
+    <xsd:element name="tags">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="tag"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="items">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="item"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="actors">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="actor"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="audio-languages">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="language"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="container">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="container"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="countries">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="country"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="directors">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="director"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="genres">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="genre"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="languages">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="language"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+\r
+    <xsd:element name="subtitle-languages">\r
+        <xsd:complexType>\r
+            <xsd:sequence>\r
+                <xsd:element maxOccurs="unbounded" ref="language"/>\r
+            </xsd:sequence>\r
+        </xsd:complexType>\r
+    </xsd:element>\r
+</xsd:schema>\r
diff --git a/data-crow/import/movie/movies-export_images/00330b7f-5df8-49fa-ad79-2d1eb8ebb38c_PictureFront.jpg b/data-crow/import/movie/movies-export_images/00330b7f-5df8-49fa-ad79-2d1eb8ebb38c_PictureFront.jpg
new file mode 100644 (file)
index 0000000..3e36496
Binary files /dev/null and b/data-crow/import/movie/movies-export_images/00330b7f-5df8-49fa-ad79-2d1eb8ebb38c_PictureFront.jpg differ
diff --git a/data-crow/import/movie/movies-export_images/0efb720d-d9e5-406b-aa42-e356f9c544e9_PictureFront.jpg b/data-crow/import/movie/movies-export_images/0efb720d-d9e5-406b-aa42-e356f9c544e9_PictureFront.jpg
new file mode 100644 (file)
index 0000000..58a1094
Binary files /dev/null and b/data-crow/import/movie/movies-export_images/0efb720d-d9e5-406b-aa42-e356f9c544e9_PictureFront.jpg differ
diff --git a/data-crow/import/movie/movies-export_images/3edf49eb-0270-456d-a15d-e5ddcba302ed_PictureFront.jpg b/data-crow/import/movie/movies-export_images/3edf49eb-0270-456d-a15d-e5ddcba302ed_PictureFront.jpg
new file mode 100644 (file)
index 0000000..6093f09
Binary files /dev/null and b/data-crow/import/movie/movies-export_images/3edf49eb-0270-456d-a15d-e5ddcba302ed_PictureFront.jpg differ
diff --git a/data-crow/import/movie/movies-export_images/a5c41732-a600-405e-bab4-c3fa24745277_PictureFront.jpg b/data-crow/import/movie/movies-export_images/a5c41732-a600-405e-bab4-c3fa24745277_PictureFront.jpg
new file mode 100644 (file)
index 0000000..4f513bb
Binary files /dev/null and b/data-crow/import/movie/movies-export_images/a5c41732-a600-405e-bab4-c3fa24745277_PictureFront.jpg differ
diff --git a/data-crow/markdown-template-example.md b/data-crow/markdown-template-example.md
new file mode 100644 (file)
index 0000000..8a7dd75
--- /dev/null
@@ -0,0 +1,24 @@
++++
+title = "#TITLE#"
+date = #CREATED#
+lastmod = #CREATED#
+description = "#DESCRIPTION#"
+
+tags = ["EMPTY"]
+categories = ["EMPTY"]
+actors = [#ACTORS#]
+directors = [#DIRECTORS#]
+writers = ["EMPTY"]
+genres = [#GENRES#]
+storage = [#STORAGE#]
+rating = ["#RATING#"]
+year = ["#YEAR#"]
++++
+#BODY#
+
+Country: #COUNTRY#  
+Language: #LANGUAGES#  
+Release Date: #RELEASEDATE#  
+Also Known As: #AKA#  
+Filming Locations: #LOCATIONS#  
+Runtime: #RUNTIME#  
\ No newline at end of file
diff --git a/data-crow/output/.gitignore b/data-crow/output/.gitignore
new file mode 100644 (file)
index 0000000..d6b7ef3
--- /dev/null
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/data-crow/run-import-to-bibliotheca.php b/data-crow/run-import-to-bibliotheca.php
new file mode 100644 (file)
index 0000000..7c96b53
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+/**
+ * Copyright 2019-2020 Johannes Keßler
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * this file creates markdown files which can be used in the static-hugo "client"
+ * reads the data-crow export from the import folder and saves the processed data into output folder
+ */
+
+# where the data crow export data is located.
+define('IMPORT_FOLDER','import/movie');
+# the data crow xml filename within the IMPORT_FOLDER
+define('DATACROW_XML_FILENAME','movies-export.xml');
+# the data crow images folder within the IMPORT_FOLDER (optional)
+define('DATACROW_IMAGES_FOLDERNAME','movies-export_images');
+# the output folder where the generead MD content will be saved
+define('OUTPUT_FOLDER','output');
+
+# the bibliotheca api endpoint
+define('API_ENDPOINT','http://localhost/bibliotheca/webclient/api.php?p=add');
+# the tolen to connect to the api.
+# created in bibliotheca use management
+define('API_TOKEN','c435168733c58b82d455d776990ff425');
+
+# the bibliotheca collection to store into
+define('BIB_COLLECTION_ID','1');
+
+
+define('DEBUG',true);
+
+mb_http_output('UTF-8');
+mb_internal_encoding('UTF-8');
+ini_set('error_reporting',-1); // E_ALL & E_STRICT
+# time settings
+date_default_timezone_set('Europe/Berlin');
+## set the error reporting
+ini_set('log_errors',true);
+ini_set('error_log','import-error.log');
+if(DEBUG === true) {
+    ini_set('display_errors',true);
+}
+else {
+    ini_set('display_errors',false);
+}
+
+require 'datacrowimport.class.php';
+
+$entries = false;
+$templateData = false;
+$created = date("Y-m-d");
+
+try {
+    // create and check some the importent settings
+    $ImportObj = new Datacrowimport(IMPORT_FOLDER, DATACROW_XML_FILENAME,
+        DATACROW_IMAGES_FOLDERNAME);
+}
+catch(Exception $e) {
+    echo $e->getMessage()."\n";
+    exit(1);
+}
+
+try {
+    // read the data using the mapping file
+    $ImportObj->readData();
+    $entries = $ImportObj->getEntries();
+}
+catch(Exception $e) {
+    echo $e->getMessage()."\n";
+    exit(1);
+}
+
+// now use the mapped entries build the data required for the api
+if(!empty($entries)) {
+    if(!file_exists(OUTPUT_FOLDER) || !is_writeable(OUTPUT_FOLDER)) {
+        echo "Can not read or write the output folder: ".var_export(OUTPUT_FOLDER, true);
+        exit(1);
+    }
+
+    $url = API_ENDPOINT.'&authKey='.API_TOKEN.'&collection='.BIB_COLLECTION_ID;
+
+    foreach ($entries as $entry) {
+        if (empty($entry['title'])) continue;
+
+        $_data = $entry;
+
+        // the resulting POST data array is key=>value (string) only
+        // only the upload can be an array
+        $_data['actors'] = implode(',',$entry['actors']);
+        $_data['tag'] = implode(',',$entry['tag']);
+        $_data['genres'] = implode(',',$entry['genres']);
+        $_data['directors'] = implode(',',$entry['directors']);
+        $_data['countries'] = implode(',',$entry['countries']);
+        $_data['languages'] = implode(',',$entry['languages']);
+
+        if(!empty($_data['coverimage'])) {
+            $_data['coverimage'] = curl_file_create($_data['coverimage']);
+            //unset($_data['coverimage']);
+        }
+        if(!empty($_data['attachment'])) {
+            // https://labs.wearede.com/php-curl-multiple-file-upload-nightmare/
+            if(is_array($_data['attachment'])) {
+                foreach($_data['attachment'] as $k=>$attach) {
+                    if(!empty($attach)) {
+                        $_data["attachment[$k]"] = curl_file_create($attach);
+                    }
+                }
+            }
+            else {
+                $_data['attachment[0]'] = curl_file_create($_data['attachment']);
+            }
+            unset($_data['attachment']);
+        }
+
+        var_dump($_data);
+        exit();
+        $do = $ImportObj->curlPostCall($url,$_data);
+        if(!empty($do)) {
+            echo "Created: ".$entry['title']."\n";
+            echo var_export($do, true)."\n";
+        }
+        else {
+            echo "can not create: ".$entry['title']."\n";
+            echo var_export($do, true)."\n";
+            exit(1);
+        }
+    }
+}
+else {
+    echo "Nothing to import from the xml file?\n";
+    exit(1);
+}
diff --git a/data-crow/run-import-to-static-md.php b/data-crow/run-import-to-static-md.php
new file mode 100644 (file)
index 0000000..057717b
--- /dev/null
@@ -0,0 +1,152 @@
+<?php
+/**
+ * Copyright 2019-2020 Johannes Keßler
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * this file creates markdown files which can be used in the static-hugo "client"
+ * reads the data-crow export from the import folder and saves the processed data into output folder
+ */
+
+# where the data crow export data is located.
+define('IMPORT_FOLDER','import/game');
+# the data crow xml filename within the IMPORT_FOLDER
+define('DATACROW_XML_FILENAME','games-export.xml');
+# the data crow images folder within the IMPORT_FOLDER (optional)
+define('DATACROW_IMAGES_FOLDERNAME','games-export_images');
+# the markdown template file used to import to
+define('MARKDOWN_TEMPLATE_FILE','markdown-template.md');
+# the output folder where the generead MD content will be saved
+define('OUTPUT_FOLDER','output');
+
+define('DEBUG',false);
+
+mb_http_output('UTF-8');
+mb_internal_encoding('UTF-8');
+ini_set('error_reporting',-1); // E_ALL & E_STRICT
+# time settings
+date_default_timezone_set('Europe/Berlin');
+## set the error reporting
+ini_set('log_errors',true);
+ini_set('error_log','import-error.log');
+if(DEBUG === true) {
+       ini_set('display_errors',true);
+}
+else {
+       ini_set('display_errors',false);
+}
+
+require 'datacrowimport.class.php';
+
+$entries = false;
+$templateData = false;
+$created = date("Y-m-d");
+
+try {
+       // create and check some the importent settings
+       $ImportObj = new Datacrowimport(IMPORT_FOLDER, DATACROW_XML_FILENAME,
+               DATACROW_IMAGES_FOLDERNAME);
+}
+catch(Exception $e) {
+       echo $e->getMessage()."\n";
+       exit(1);
+}
+
+try {
+       // read the data using the mapping file
+       $ImportObj->readData();
+       $entries = $ImportObj->getEntries();
+}
+catch(Exception $e) {
+       echo $e->getMessage()."\n";
+       exit(1);
+}
+
+// now use the mapped entries, apply the template file and create the folders and md files
+if(!empty($entries)) {
+       if(file_exists(IMPORT_FOLDER.'/'.MARKDOWN_TEMPLATE_FILE) && is_readable(IMPORT_FOLDER.'/'.MARKDOWN_TEMPLATE_FILE)) {
+               $templateData = file_get_contents(IMPORT_FOLDER.'/'.MARKDOWN_TEMPLATE_FILE);
+               if(empty($templateData)) {
+                       echo "Can not get the contents of the template file: ".var_export(IMPORT_FOLDER.'/'.MARKDOWN_TEMPLATE_FILE, true);
+                       exit(1);
+               }
+       }
+       else {
+               echo "Can not read the markdown template file: ".var_export(IMPORT_FOLDER.'/'.MARKDOWN_TEMPLATE_FILE, true);
+               exit(1);
+       }
+
+       if(!file_exists(OUTPUT_FOLDER) || !is_writeable(OUTPUT_FOLDER)) {
+               echo "Can not read or write the output folder: ".var_export(OUTPUT_FOLDER, true);
+               exit(1);
+       }
+
+       foreach ($entries as $entry) {
+               if(empty($entry['title'])) continue;
+
+               $entry['created'] = $created;
+
+               $saveFolder = OUTPUT_FOLDER.'/'.strtoupper($entry['title'][0]);
+               if(!file_exists($saveFolder)) {
+                       mkdir($saveFolder);
+               }
+               file_put_contents($saveFolder.'/_index.md','');
+               $saveFolderMovie = $saveFolder.'/'.saveDirname($entry['title']);
+               if(!file_exists($saveFolderMovie)) {
+                       mkdir($saveFolderMovie);
+               }
+               $saveFolderImages = $saveFolderMovie.'/images';
+               if(!file_exists($saveFolderImages)) {
+                       mkdir($saveFolderImages);
+               }
+
+               $saveData = $templateData;
+               foreach($entry as $k=>$v) {
+                       $_search = '#'.strtoupper($k).'#';
+
+                       if(is_array($v)) {
+                               $saveData = str_replace($_search,'"'.implode('","',$v).'"',$saveData);
+                       }
+                       elseif(strpos($k,"file_") !== false) {
+                               if(!empty($v)) {
+                                       $_filename = str_replace("file_","",$k);
+                                       $_fileinfo = pathinfo($v);
+                                       $_filename .= ".".$_fileinfo['extension'];
+
+                                       copy($v, $saveFolderImages.'/'.$_filename);
+                               }
+                       }
+                       else {
+                               $saveData = str_replace($_search,$v,$saveData);
+                       }
+               }
+
+               file_put_contents($saveFolderMovie.'/index.md',$saveData);
+
+               echo "Created: ".$entry['title']."\n";
+       }
+}
+else {
+       echo "Nothing to import from the xml file?\n";
+       exit(1);
+}
+
+function saveDirname($string) {
+       $ret = trim($string);
+       $ret = strtolower($ret);
+
+       $ret = preg_replace('/[^\p{L}\p{N}]/u',"-",$ret);
+
+       return $ret;
+}