Developer forum

Forum » Integration » Data integration - export pages, paragraphs and items from specific area

Data integration - export pages, paragraphs and items from specific area

René Poulsen
René Poulsen
Reply

Hi,

I haven't been working much with the dataintegration when it comes to exporting content from DW, but I've managed to set up an export that exports (selected fields) from all itemtypes and pages + paragraphs. However I can't seem to find a way for exporting these for only a specific area. I've got two areas (websites) on the solution and I only wan't to export all the data for one area (area ID = 2) and not the other one.

Is it somehow possible? If yes, how? :-)


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Rene,
you can add a filter on the mappings:

But that will only filter out the pages, but not the paragraphs.

You can use the Item provider to export item types data and add a filter on "RelevantAreaID" column.

Best regards, Dmitrij

 
René Poulsen
René Poulsen
Reply

Hi Dmitriy,

I've just found exactly that option - but when I do like you do above, nothing is exported.

I've just removed the condition / filter from one of the items (ItemType_Case). Whan I look into the XML, the "RelevantAreaID" is empty for both cases (one is located on the website with area id = 1 and the other = 2)

The XML looks like this;

<table tableName="Case">
    <item table="Case">
      <column columnName="Id"><![CDATA[1]]></column>
      <column columnName="Headline"><![CDATA[Lorem ipsum header]]></column>
      <column columnName="Teaser"><![CDATA[Lorem ipsum teaser]]></column>
      <column columnName="RelevantAreaID"><![CDATA[]]></column>
    </item>
    <item table="Case">
      <column columnName="Id"><![CDATA[2]]></column>
      <column columnName="Headline"><![CDATA[UK Lorem ipsum header]]></column>
      <column columnName="Teaser"><![CDATA[UK Lorem ipsum teaser]]></column>
      <column columnName="RelevantAreaID"><![CDATA[]]></column>
    </item>
  </table>
 
René Poulsen
René Poulsen
Reply

BTW: I'm on a 9.6.3 solution.

EDIT: Updated to 9.7.2. Same problem.

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Field RelevantAreaID is filled only if your ItemType is used on the Website -> Advanced Ribbon bar -> Item Type.
You can also look on extensibility point to implement your own filtering functionality using Table script and ProcessInputRow method:
https://doc.dynamicweb.com/forum/integration/integration/exclude-rows-from-update

 
René Poulsen
René Poulsen
Reply

I don't think I understand this. Does the item has to be seleted as the item for "Website properties"? If this is correct, then I can't really use it, as my items are acutal content (pages and parageaphs based on items) and not just an item for website properties.

A lot of our customers ask for a way to export content for one website. Is there no way to do this with standard DW functionality?

 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Rene,
as an other alternative you can use the database views and create the DynamicwebView Provider -> your destination provider job.
Here is an example sql to get the Newsletter items that are used on Pages and Paragraphs that are in AreaId = 9 and it can be saved as view in the Dynamicweb database.

select n.* from ItemType_Newsletter n
inner join
(
--select pages
SELECT PageID AS ID, PageItemType AS ItemType, PageItemId AS ItemId FROM Page WHERE PageItemType <> '' AND PageItemType IS NOT NULL AND PageItemId <> '' AND  PageItemId IS NOT NULL
and PageAreaId = 9
union
--select paragraphs
SELECT ParagraphID AS ID, ParagraphItemType AS ItemType, ParagraphItemId AS ItemId FROM Paragraph
inner join Page on ParagraphPageId = PageId
WHERE PageAreaId = 9 and
ParagraphItemType <> '' AND ParagraphItemType IS NOT NULL AND ParagraphItemId <> '' AND  ParagraphItemId IS NOT NULL
) pagesAndParagraphs
on n.Id = pagesAndParagraphs.ItemId and pagesAndParagraphs.ItemType = 'Newsletter'

Other aleternative can be to use the Deployment tool that can select data from the needed area from one website and import that to another.

Best regards, Dmitrij

 
René Poulsen
René Poulsen
Reply

Hi Dmitriy,

Yeah, I thought of that as well. I would like to avoid usin SQL, but if it's the only option maybe I'll have to go that way instead.

Thank you for the replies :-)

 

You must be logged in to post in the forum