BatchImport Sharepoint Blog Extension

Version 9.1 by Ludovic Dubost on 2014/02/10 18:19
Warning: For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

cogBatchImport extension allowing to import Sharepoint Blog exports.
TypeXAR
Category
Developed by

Ludovic Dubost

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

Testing on XWiki 5.4

Installable with the Extension Manager

Description

This extension to the BatchImport application allows to import Sharepoint blogs.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Here are the installations and usage instructions.

Export the Sharepoint Blog

Export the Sharepoint blog using the Sharepoint Admin Interface. (More info to come).

The result of the export should be:

  • An xlsx file which you will need to convert to xls (Excel 97). The result depends on the language of your interface and should look like this file (the example is an export coming out of a Brasilian/Portuguese Sharepoint installation).
  • A set of directories. In the case of the Brasilian/Portuguese installation the directory tree should contain at least the following directories
    • Documentos
    • Lists
    • Lists/Fotos

Copy the content to the server or computer on which your XWiki instance is installed. The server should be able to read that content, otherwise the file importing will fail.
You can try with the sample blogimport.zip file.

Install XWiki's BatchImport application

You will need to install the XWiki Batch Import application. To do this you need to first:

Failed to execute the [velocity] macro. Cause: [Nested scripts are not allowed. Current Script Macro [velocity] (source [extensions:ExtensionCode.ExtensionSheet]) is executed inside Script Macro [velocity] (source [extensions:ExtensionCode.ExtensionSheet])]. Click on this message for details.

Install the Blog Batch Import

You then can install the Blog Batch Import using XWiki's Extension Manager.

Configure the BlogBatchImport for your use case

You will need to modify the Blog Batch Import to be able to be used for your configuration. You will need to change the following things:

Modify the BlogBatchImportGroovy script

For this edit the BlogBatchImportGroovy page in Wiki mode. You will find the following lines in this script:

// THINGS TO CONFIGURE ARE HERE
// name of categorie field
def CATEGORY = "Categoria"

// prefix for files and images
def PREFIX = "prefix"

def WEBSITEURL = "http://blogbatchimport.xwiki.org"

// END THINGS TO CONFIGURE
  • The first setting is the Sharepoint blog property name used for Categories. It depends on the language of your installation. 
  • The second setting is the name of the url path where files and images are found. This is necessary to properly identify URL links representing images and files available in the export
  • The third setting is the URL of your old server or any URL you would like to use to prefix any relative link found in the articles. These links correspond to links towards other content of Sharepoint which are not files and attachments of the blog. By prefixing it by a server you control you can then setup redirects in your server to point to the right place where you content is or will be.

Once you have mande modifications to this page you need to activate it by visiting the page BlogBatchImportGroovyInstall

Set the data directory in the BlogBatchImport page in editobject mode

Visit the the BlogBatchImport in "edit object" mode. You will find the "edit object" link in the edit drop down menu if you have the "Advanced User" setting  (change this setting in your profile preferences). Alternatively append "?editor=object" to the edit page of the  BlogBatchImport page.

On this screen you need to edit the "datafilename" field and point it to the directory where the wiki can find the extracted content of your Sharepoint content. The files should be copied over to where you XWiki instance is installed.

blogimport_directorysettings.png

Use the BlogBatchImport

Start

Visit BlogBatchImport. On this screen you will see that you can select the sample BlogContent.xls (corresponding to the files and images in the sample blogcontent.zip) or select your own XLS file after importing it.

blogimport_start.png

Settings

On the settings screen, you will need to change the setting if the language of your Sharepoint installation is not portuguese. Assign the right fields from your excel file to the right XWiki fields. Additionally you need to set the default date (otherwise your dates won't be properly converted). The value to set is (with white spaces between each date item and colon between each time item):

dd MM yyyy HH:mm:ss

You can see the result on the following screenshot:

blogimport_settings.png

Preview Import

The next screen will allow you to preview the import. You should get something in every field, except for the "Attachments" field which is empty for some lines, but has some values for other. It's important to verify that the page name and title is correct, that you get something in the page content, that you can see the categories and that the date is showing something valid.

blogimport_preview.png

Choose Data Duplication Setting

On the data duplication setting screen it's important to choose "Generate" for the first option and "Update" for the second.
The first option will tell the importer how to handle articles that have the same title. The second option is only important when you re-run the importer a second time.

blogimport_dataduplication.png

Import Simulation

On the next screen you should see the result of the import simulation. In particular this will check that the attached files or images are found on the disk. If you get errors on this screen this will probably mean the directory is not set properly for the tool to find the files. Check in the settings section.

blogimport_simulation.png

Final Import Screen

On the final import screen you get to verify that everything went fine. The result should look like this:

blogimport_final.png

Import Result

You can see the import result on the home page of the Blog

As you can see the categories are imported (as you can see the number of articles per category) as well as the blog content and images.

blogimport_result.png

Get Connected