Try our conversational search powered by Generative AI!

Import data from external source functionality on page for Editor

Vote:
 

Hi Experts,

We are working on importing data on regular interval from external system into CMS (ver: 10.8). Once pages are created into CMS from external data, we want to give Editor an option for explicitly updating data for a single page. Can we provide a button on a page in EditMode so that Editor can fetch data for that page? Is this doable and if yes, what event we will fire at backend so that we can get data from external system again.

#187390
Jan 22, 2018 13:46
Vote:
 

Hi,

You can extend the Episerver UI in order to accomplish your goal. I'd recommend adding an item to the context menu (right click menu) since it's easy to do, and you won't need to learn too much Dojo to accomplish your goal. An example of plugging in a context menu command can be found here:

https://world.episerver.com/blogs/Tahir-Naveed/Dates/2016/11/adding-a-menu-item-into-context-menu---episerver-10-1-way/

Once you have the option in the menu, add an API that you can call to trigger the sync with the external system, and call it from javascript within your Dojo component. You'll have access to the contentLink in the Model of your component, so send that back so you know which content item to update. The full client-side data model can be found here: 

https://world.episerver.com/documentation/developer-guides/CMS/user-interface/plug-in-areas/

Make sure you properly secure your API to ensure it can only be called by Editors/Admins. Once the data sync finishes, you'll have a new version of your content, so you'll need to send that new content reference (with updated workId) back in the response, and refresh the view from Dojo. See "Changing the Current Context" in this article: https://world.episerver.com/documentation/developer-guides/CMS/user-interface/Context-sensitive-components/

I'd recommend you take a look at the User Interface section of the developer guides to familiarize yourself with the concepts before you get started.

https://world.episerver.com/documentation/developer-guides/CMS/user-interface/

Hope this helps,

/Matt

#187403
Jan 22, 2018 16:33
Vote:
 

Thanks for this detail information Matt. Is there something we can provide Editor on page so that editor can refersh data for that page only ( page may consist many blocks and other custom properties)

#187406
Jan 22, 2018 17:02
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.