Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The first step is to take a step back and evaluate your business requirements. Will you allow for users to be updating the information with forms in the frontend? Do you need a tree editor for the content in the backoffice? Do you need to be work with data outside of the built-in ORM? </p> <p>If the answer to these is no, a hive provider is overkill. Evaluate solutions using either a simple surface controllers, or just a <a href="http://our.umbraco.org/wiki/how-tos/working-with-document-types" rel="nofollow">custom document type</a>. Umbraco 5 is a full EAV/CR system, so unlike some CMS products, you'll be able to represent any rdbs structure you can imagine</p> <p>ContentExample could be represented be a document type called 'Article', which has properties Title and Text. Just by defining this document type we're instantly given add and edit forms for our back office users in our content section. We can even restrict which nodes are able to have children of type 'Article', e.g News.</p> <p>In the same way, an upload control is a field type that allows you to attach files to your document.</p> <p>So what's point of a custom hive provider?</p> <p>The goal of a custom hive provider is to unify CRUD actions for data access layers. As a result data can be stored in the baked-in nhibernate orm, custom tables, rss feeds, or even flat files, while still using a common interface to retrieve and update it. If this sounds like what you're aiming for, read on.</p> <p>Going back to the business requirements, specifically, where do you want to actually <em>store</em> the data?--Given that you have some fields and properties related to flat file storage, let's say that one TypedEntity (a model) is equivelant to one file and write some pseduocode:</p> <p>The first step, is as you say 'get the data into the repository.' This involves going back to that VS template and filling in the 'not implemented' methods with your logic for storing and retrieving data.</p> <pre><code> protected override void PerformAddOrUpdate(TypedEntity entity) { // step 1: serialize the typed entity to xml // step 2: write the file to the hdd, making sure that the file name is named using the hive id so that we can pull it back later. } </code></pre> <p>Once you've written the data access layer, or DAL, you can hook it up in the hive config, giving it url to match. e.g. rather than matching content:\\, yours might match on file-manager:\\</p> <p>We can allow our backoffice users to be able to add new entities (indirectly, new files) by writing <a href="http://web-matters.blogspot.com/2011/11/umbraco-5-hive-provider-tree-editor.html" rel="nofollow">a custom tree</a>, and we can display the results to our front-end users via macros.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload