From version 43.2
edited by slauriere
on 2019/01/07 00:15
To version 44.1
edited by Jean-S├ębastien Dennebouy
on 2019/01/09 14:15
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.slauriere
1 +xwiki:XWiki.jsd
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -16,37 +16,37 @@
16 16  
17 17  == Example ==
18 18  
19 -Here is an example of the import, performed on data based on http://www.danceireland.ie/downloads/library/Resource-room-library-catalogue.xls , during which we will import a library catalogue from excel to an application in the wiki. Since the initial excel file was designed for print, we touched it a bit to make it suitable for import. The modified version is [[here>>attach:Resource-room-library-catalogue.xls]] .
19 +Here is an example of the import, performed on data based on https://www.danceireland.ie/content/files/Resource-room-library-catalogue.xls, during which we will import a library catalogue from excel to an application in the wiki. Since the initial excel file was designed for print, we touched it a bit to make it suitable for import. The modified version is [[here>>attach:Resource-room-library-catalogue.xls]] .
20 20  
21 21  First, we create the application with a text field for the author, a number field for the number of copies in store, a date field for the publication year (whose format we configure to display only year), and a boolean field to mark whether the item can be loaned or can only be consulted in the library. We will store the title of the publication in the document title, and the id of the publication in the page name (since id is unique and page name is also an identifier of the item).
22 22  
23 -{{image reference=createApplication.png/}}
23 +{{image reference="createApplication.png"/}}
24 24  
25 25  Then, as explained in the "How to use" section above, we proceed to the import: in the first step of the wizard, we upload the xls file and select it:
26 26  
27 -{{image reference=selectFile.png/}}
27 +{{image reference="selectFile.png"/}}
28 28  
29 -{{image reference=selectFile-Uploaded.png/}}
29 +{{image reference="selectFile-Uploaded.png"/}}
30 30  
31 31  In the second step of the wizard, we can choose the mapping between the fields of the XWiki class of the application and the columns of the file to import (note that, compared to the initial xls, we moved the DVD sheet in the first position, so we're importing DVDs now):
32 32  
33 -{{image reference=columnMapping.png/}}
33 +{{image reference="columnMapping.png"/}}
34 34  
35 35  Then, a preview of the mapping is displayed (the first ten rows), to show how will the data from the file be processed and parsed according to the types of the fields of the XWiki Class (since conversion needs to be possible automatically):
36 36  
37 -{{image reference=mappingPreview.png/}}
37 +{{image reference="mappingPreview.png"/}}
38 38  
39 39  Upon confirming of the mapping, we will be able to choose the overwrite options for the import: since, in the mapping step, we chose a file column to be mapped on the document name, we need to specify now how should the import behave when two rows in the file have the same value for the document name column. Also, if a page with the same name already exists in the wiki, we need to specify how should the import wizard behave in such situation.
40 40  
41 -{{image reference=overwriteOptions.png/}}
41 +{{image reference="overwriteOptions.png"/}}
42 42  
43 43  The next step is an import simulation for the whole source file, showing what will happen during the actual import:
44 44  
45 -{{image reference=importSimulation.png/}}
45 +{{image reference="importSimulation.png"/}}
46 46  
47 47  And finally, after the import simulation we can actually perform the import (using the button at the bottom of the import simulation log) and see the data imported in the application, on the application home table:
48 48  
49 -{{image reference=importedData.png/}}
49 +{{image reference="importedData.png"/}}
50 50  
51 51  To show error handling and some special configurations of the import, we will now import the "Guides and Publications" from the excel in the same application and, since it has pretty irregular dates, we will import it as a CSV file this time.
52 52  
... ... @@ -56,34 +56,34 @@
56 56  
57 57  First we export the Guides and Publications sheet in a CSV file from the Excel tool we use (resulting [[this file>>attach:Resource-room-library-catalogue.csv]]) and then we upload it in the wizard as we did for the previous file:
58 58  
59 -{{image reference=importCsv.png/}}
59 +{{image reference="importCsv.png"/}}
60 60  
61 61  Upon column mapping we can see that the old mapping was stored, as much as possible, and displayed as defaults for this new import (the column names for author and publication date differ from the DVDs to Guides and Publication tab).
62 62  
63 -{{image reference=mappingSave.png/}}
63 +{{image reference="mappingSave.png"/}}
64 64  
65 65  Since the dates of the Guides and publications are irregular, as we can see in this screenshot of the excel tool:
66 66  
67 -{{image reference=excelData.png/}}
67 +{{image reference="excelData.png"/}}
68 68  
69 69  ... we will also set the date format in the column mapping screen, thus helping the import tool parse these "non-conform" dates:
70 70  
71 -{{image reference=dateFormat.png/}}
71 +{{image reference="dateFormat.png"/}}
72 72  
73 73  On the mapping preview step we only see the first 10 lines, so we cannot see the dates being parsed correctly as "MMM-yy":
74 74  
75 -{{image reference=mappingPreviewGP.png/}}
75 +{{image reference="mappingPreviewGP.png"/}}
76 76  
77 77  ... but on the simulation step we can see that the only errors are coming from 4 rows which really have unparsable dates:
78 78  
79 -{{image reference=importSimulationWithError.png/}}
79 +{{image reference="importSimulationWithError.png"/}}
80 80  
81 81  Note that these rows with errors are completely ignored on import, but could be imported in a second import, removing the date mapping and configuring overwrite so that the existing documents from the previous import are not modified, or they could be corrected in the initial excel so that they can be imported along with the rest of the file.
82 82  
83 83  After the perform of the import in the last step of the wizard, we can see that the couple of dates in the "MMM-yy" format we saw in the initial excel are properly parsed to the corresponding dates in the wiki:
84 84  
85 -{{image reference=importedDateFormat.png/}}
85 +{{image reference="importedDateFormat.png"/}}
86 86  
87 87  Finally, in the home page of our library application, we can see all the data, DVD and Guides and Publications together:
88 88  
89 -{{image reference=allImportedData.png/}}
89 +{{image reference="allImportedData.png"/}}

Get Connected