Developers who write applications targeting DNN’s Liquid Content service need a simple way to validate access to their data. The Liquid Content Explorer aims to simplify this and let developers navigate various Liquid Content types and content items--and view their various sub elements in a Windows Explorer tree-like viewport.
The demo code is based on Windows Forms desktop application that can be loaded and compiled with Visual Studio 2015 or higher with .NET Framework 4.5.2 or higher. The application uses Windows forms to read and display the content structure types and items. When loading the application in Visual Studio you should see a window like this one.
The solution is composed of two projects:
- Windows Form project LiquidContentExplorer which contains the views and UI
- The Structured-Content Models project StructuredContent.Models which contains the .NET classes representing the entities stored in SC
The values for the text boxes (A) and (B) are filled with values obtained from the "App.config" file:
When running the application, you will see a window like this (without any data at first).
After clicking the Load Content (if the values in A and B are valid), the application will perform the following three tasks:
- Request the API version from the service and display it in the API "Version text" box.
- Send a request to the service to GET the added content types and display them in the tree pane.
- Send a request to the service to GET the added content data records and display them in the tree pane.
Note: when de-serializing the content types in Step 2 above, you need to use a typed conversion de-serializer for this to work with all the defined structured content types. The models project contains the necessary converter to be used. Here is an example:
The sample code contains a *token* that has read-only permission for the data. To be able to insert/update/delete any content, you need to obtain a token with a "write" permission.
As you can see, it’s actaully quite easy to build an application to consume data from Evoq Liquid Content.