How to import your comments to SolidOpinion

This article is intended to help developers better understand requirements & structure of the XML document needed to import comments from any built-in or third-party commenting system into SolidDiscussion. Currently supported sources are:
First your XML file should start with a prologue, that opens the document itself & declares the UTF-8 encoding used within:
  <?xml version="1.0" encoding="utf-8"?>  
Then, within the <so> ... </so> tag you need to provide details on two main types of elements: Threads & Posts. 

A typical Thread element is represented by following details:

id - unique identitifer of the comments thread.
link - URL of the page thread is attached to.
title - title of the page thread is attached to. Used in the SolidOpinion Community Widget.

You can see a typical thread example below:
<thread id="1">
  <link>http://yoursitedomainname/?p=59</link>
  <title><![CDATA[title]]></title>
</thread>  
After all threads are declared please continue with Posts, that should carry following details in the standard tree structure:

id - unique identifier of the post within the thread.
thread id - idenfifier of the thread post is attached to. Used to build the connections between posts & threads.
parent id - identifier of the parent post. Used to build post hierrarchy within the thread (ex: post x is an answer to post y etc.).

Note: Please mind that Parent posts should be declared in the document before the posts reffering to them via parent id. See example below.

message - body of the comment message.
creatredAt - date & time the comment was added. Please use following datatime format -  2014-05-13T14:50:02Z.
usermail - e-mail of the user who has added the comment.
username - name of the user who has added the comment.
rating - indicates post rating displayed as five-star voting system next to each comment (if it's enabled).

Typical post example:
<post id="2">
<thread id="1" />
<parent id="1" />
    <message><![CDATA[<p>message</p>]]></message>
    <createdAt>2014-05-13T14:50:02Z</createdAt>
    <useremail>example@test.com</useremail>
    <username><![CDATA[user]]]></username>
</post>
The whole XML document should be built using the elements described above. Here's the sample XML file used for data import:
<?xml version="1.0" encoding="utf-8"?>
<so>
<thread id="1">
  <link>http://yoursitedomainname/?p=59</link>
  <title><![CDATA[title]]></title>
</thread>

<thread id="2">
  <link>http://www.yoursitedomainname.com/36/</link>
  <title><![CDATA[title1]]></title>
</thread>

<thread id="3">
  <link>http://yoursitedomainname/page/</link>
  <title><![CDATA[title2]]></title>
</thread>

<thread id="4">
  <link>http://yoursitedomainname/?p=4</link>
  <title><![CDATA[title3]]></title>
</thread>

<thread id="5">
  <link>http://yoursitedomainname/?p=1</link>
  <title><![CDATA[title4]]></title>
</thread>

<post id="10">
<thread id="2" />
<message><![CDATA[<p>message</p>]]></message>
  <createdAt>2014-05-13T14:50:02Z</createdAt>
    <useremail>example@test.com</useremail>
    <username><![CDATA[user]]></username>
    <rating>5</rating>
</post>

<post id="11">
<thread id="2" />
<parent id="10" />
    <message><![CDATA[<p>message</p>]]></message>
    <createdAt>2014-05-13T14:50:02Z</createdAt>
    <useremail>example@test.com</useremail>
    <username><![CDATA[user]]]></username>
</post>

<post id="12">
<thread id="4" />
    <message><![CDATA[<p>message</p>]]></message>
    <createdAt>2014-05-13T14:50:02Z</createdAt>
    <useremail>example@test.com</useremail>
    <username><![CDATA[user]]></username>
</post>

<post id="13">
    <thread id="5" />
    <message><![CDATA[<p>message</p>]]></message>
    <createdAt>2014-05-13T14:50:02Z</createdAt>
    <useremail>example@test.com</useremail>
<username><![CDATA[user]]></username>
</post>

<post id="14">
    <thread id="5" />
    <message><![CDATA[<p>message</p>]]></message>
    <createdAt>2014-05-13T14:50:02Z</createdAt>
    <useremail>example@test.com</useremail>
    <username><![CDATA[user]]></username>
</post>

</so>
In order to export external comments into SO commenting system the publisher needs to create comments exporting file using one of three described formats and a Shortname of the site where comments will be imported to.

Once you have the file with your data that looks like the one shown above please contact SolidOpinion Support via  solidopinion.com or e-mail to arrange your data import.


Happy Commenting!
SolidOpinion

Feedback and Knowledge Base