updated docs
This commit is contained in:
@@ -68,9 +68,9 @@
|
||||
<header class="header">
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container-fluid">
|
||||
<div class="container">
|
||||
|
||||
<a class="brand">Umbraco 7</a>
|
||||
<a class="brand">Umbraco 7</a>
|
||||
|
||||
<ul class="nav">
|
||||
<li ng-repeat="(url, name) in sections" ng-class="{active: isActivePath(url)}">
|
||||
@@ -83,10 +83,10 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div role="main" class="container-fluid">
|
||||
<div class="row-fluid clear-navbar"></div>
|
||||
<div role="main" class="container">
|
||||
<div class="row clear-navbar"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<!--[if lt IE 7]>
|
||||
<p class="alert alert-error">Your browser is <em>ancient!</em>
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="row">
|
||||
<div class="span3">
|
||||
<form class="well form-search" ng-submit="submitForm()">
|
||||
<div class="dropdown search"
|
||||
|
||||
@@ -198,7 +198,7 @@ NG_DOCS={
|
||||
"id": "umbraco.resources.contentResource",
|
||||
"shortName": "contentResource",
|
||||
"type": "service",
|
||||
"keywords": "api content contentresource data for in loads resources service umbraco"
|
||||
"keywords": "$http $q $scope accesible again alert alias all an and angular any api application applied are args arguments array as ascending async attached base based be been below bin build by can changes children collection complete completed containing content contentarray contentresource contenttype controller create creation current data database default delete deletebyid deletes descending document editors empties empty emptyrecyclebin entities entity existing false files filter for force from getbyid getbyids getchildren gets getscaffold given gone handles has have here homepage id ids if index inject into is isnew it item items its knows made make matching method methods module must my mydoc name names needs new node node-ids nodes not number object of on only operations optional options or order orderby orderdirection page pagenumber pagesize paging param paramater parent parentid passed per place populated promise properties property provided publishcontent published publishes put query recycle resource resourcepromise resources retrieved return returns savecontent saved saves scaffold seperately service set should simply so sort sorted sortedids sortorder sorts store sure that the then they those to transactions true type umbdataformatter umbraco umbrequesthelper underneath untill update updated usage use used using var version want webapi where which will with won yet"
|
||||
},
|
||||
{
|
||||
"section": "api",
|
||||
@@ -207,6 +207,13 @@ NG_DOCS={
|
||||
"type": "service",
|
||||
"keywords": "api content contenttyperesource data for in loads resources service types umbraco"
|
||||
},
|
||||
{
|
||||
"section": "api",
|
||||
"id": "umbraco.resources.entityResource",
|
||||
"shortName": "entityResource",
|
||||
"type": "service",
|
||||
"keywords": "alert all an and api basic containing contains data display ent entities entity entityresource for getbyid gets given here id in is it item its lists loads method most mydoc navigation node object of only properties representation resourcepromise resources return service the then to trees umbraco usage used var what with"
|
||||
},
|
||||
{
|
||||
"section": "api",
|
||||
"id": "umbraco.resources.legacyResource",
|
||||
@@ -268,7 +275,7 @@ NG_DOCS={
|
||||
"id": "umbraco.services.dialogService",
|
||||
"shortName": "dialogService",
|
||||
"type": "service",
|
||||
"keywords": "$compile $http $log $q $rootscope $templatecache accesible all also an and animation any api application-wide array attach attached be been body but by callback called can chosen class close closeall closes container contains content contentpicker controller css csss custom data default dialog dialogs dialogservice div document documents does dom done edit editor element existing fade for from function functon given handling has html iframe iframes in incase inject injects inline instantly into is it items its load macro macropicker make mcaro media mediapicker method modal modalclass modals module needed needs new non-angular object of on only open opens options or overlays page parameters passed path picker processing property propertydialog rendering renders representing return returned returns rootscope scope selected sent serverside service services set should show simply specific strips submitted support sure template templates that the this to tree true umb-modal umbraco url usage use used value var want whatever when which width with wrappers you ysod ysoddialog"
|
||||
"keywords": "$compile $http $log $q $rootscope $templatecache accesible all also an and animation any api application-wide array attach attached be been body but by callback called can chosen class close closeall closes container contains content contentpicker controller css csss custom default dialog dialogs dialogservice div document documents does dom done edit editor element existing fade for from function functon given handling has html iframe iframes in incase inject injects inline instantly into is it items its load macro macropicker make mcaro media mediapicker method modal modalclass modals module needed needs new non-angular object of on only open opens options or overlays page parameters passed path picker processing property propertydialog rendering renders representing return returned returns rootscope scope selected sent serverside service services set should show simply specific strips submitted support sure template templates that the this to tree true umb-modal umbraco url usage use used value var want whatever when which width with wrappers you ysod ysoddialog"
|
||||
},
|
||||
{
|
||||
"section": "api",
|
||||
@@ -310,7 +317,7 @@ NG_DOCS={
|
||||
"id": "umbraco.services.serverValidationManager",
|
||||
"shortName": "serverValidationManager",
|
||||
"type": "service",
|
||||
"keywords": "according addfielderror addpropertyerror adds alias all always an and another any api are attached be been below bound call callback callbacks can change changes checks clear clears colleciton collection combo content contentproperty controller controls created data defined directive empty error errors errros example executed explicit field fieldname fields for form function generally getfieldcallbacks getfielderror getpropertycallbacks getpropertyerror gets handle has hasfielderror haspropertyerror if in is item just listen match message messages method methods model name named native needs new not notifies now null objects occurs of once one ones only order other otherwise over particular persisted pinpoint previously primarily properties property re-binded re-bound registered removepropertyerror removes reset return route rules scenarios scope server servervalidationmanager service services set should side so specific specified specifies submitting subscribe subscription that the their then there these they this to types ui umbraco up used user using val-server valid validation vs we when whenever where which will wires with"
|
||||
"keywords": "according addfielderror addpropertyerror adds alias all always an and another any api are attached be been below bound call callback callbacks can change changes checks clear clears colleciton collection combo content controller controls created data defined directive empty error errors errros example executed explicit field fieldname fields for form function generally getfieldcallbacks getfielderror getpropertycallbacks getpropertyerror gets handle has hasfielderror haspropertyerror if in is item just listen match message messages method methods model name named native needs new not notifies now null objects occurs of once one ones only order other otherwise over particular persisted pinpoint previously primarily properties property propertyalias re-binded re-bound registered removepropertyerror removes reset return route rules scenarios scope server servervalidationmanager service services set should side so specific specified specifies submitting subscribe subscription that the their then there these they this to types ui umbraco up used user using val-server valid validation vs we when whenever where which will wires with"
|
||||
},
|
||||
{
|
||||
"section": "api",
|
||||
|
||||
@@ -3,5 +3,271 @@
|
||||
)</span>
|
||||
</h1>
|
||||
<div><h2 id="Description">Description</h2>
|
||||
<div class="description"><p>Loads/saves in data for content</p></div>
|
||||
<div class="description"><p>Handles all transactions of content data
|
||||
from the angular application to the Umbraco database, using the Content WebApi controller</p>
|
||||
|
||||
<p>all methods returns a resource promise async, so all operations won't complete untill .then() is completed.</p></div>
|
||||
<h2 id="Dependencies">Dependencies</h2>
|
||||
<ul class="dependencies"><li><code ng:non-bindable=""><a href="api/$q">$q</a></code>
|
||||
</li>
|
||||
<li><code ng:non-bindable=""><a href="api/$http">$http</a></code>
|
||||
</li>
|
||||
<li><code ng:non-bindable=""><a href="api/umbDataFormatter">umbDataFormatter</a></code>
|
||||
</li>
|
||||
<li><code ng:non-bindable=""><a href="api/umbRequestHelper">umbRequestHelper</a></code>
|
||||
<h2 id="usage">usage</h4>
|
||||
|
||||
<p>To use, simply inject the contentResource into any controller or service that needs it, and make
|
||||
sure the umbraco.resources module is accesible - which it should be by default.</p>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.getById(1234)
|
||||
.then(function(data) {
|
||||
$scope.content = data;
|
||||
});
|
||||
</pre> </p></li>
|
||||
</ul>
|
||||
<div class="member method"><h2 id="Methods">Methods</h2>
|
||||
<ul class="methods"><li><h3 id="deleteById">deleteById(id)</h3>
|
||||
<div class="deletebyid"><p>Deletes a content item with a given id</p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.deleteById(1234)
|
||||
.then(function() {
|
||||
alert('its gone!');
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">id {Int} </code>
|
||||
<p>id of content item to delete </p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><h3 id="emptyRecycleBin">emptyRecycleBin()</h3>
|
||||
<div class="emptyrecyclebin"><p>Empties the content recycle bin</p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.emptyRecycleBin()
|
||||
.then(function() {
|
||||
alert('its empty!');
|
||||
});
|
||||
</pre> </p><h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><h3 id="getById">getById(id)</h3>
|
||||
<div class="getbyid"><p>Gets a content item with a given id</p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.getById(1234)
|
||||
.then(function(content) {
|
||||
var myDoc = content;
|
||||
alert('its here!');
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">id {Int} </code>
|
||||
<p>id of content item to return </p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object containing the content item.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><h3 id="getByIds">getByIds(ids)</h3>
|
||||
<div class="getbyids"><p>Gets an array of content items, given a collection of ids</p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.getByIds( [1234,2526,28262])
|
||||
.then(function(contentArray) {
|
||||
var myDoc = contentArray;
|
||||
alert('they are here!');
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">ids {Array} </code>
|
||||
<p>ids of content items to return as an array </p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object containing the content items array.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><h3 id="getByIds">getByIds(ids)</h3>
|
||||
<div class="getbyids"><p>Gets an array of content items, given a collection of ids</p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.getByIds( [1234,2526,28262])
|
||||
.then(function(contentArray) {
|
||||
var myDoc = contentArray;
|
||||
alert('they are here!');
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">ids {Array} </code>
|
||||
<p>ids of entities to return as an array </p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object containing the entity array.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><h3 id="getChildren">getChildren(parentid, options)</h3>
|
||||
<div class="getchildren"><p>Gets children of a content item with a given id</p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.getChildren(1234, {pageSize: 10, pageNumber: 2})
|
||||
.then(function(contentArray) {
|
||||
var children = contentArray;
|
||||
alert('they are here!');
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">parentid {Int} </code>
|
||||
<p>id of content item to return children of</p></li>
|
||||
<li><code ng:non-bindable="">options {Object} </code>
|
||||
<p>optional options object</p></li>
|
||||
<li><code ng:non-bindable="">options.pageSize {Int} </code>
|
||||
<p>if paging data, number of nodes per page, default = 0</p></li>
|
||||
<li><code ng:non-bindable="">options.pageNumber {Int} </code>
|
||||
<p>if paging data, current page index, default = 0</p></li>
|
||||
<li><code ng:non-bindable="">options.filter {String} </code>
|
||||
<p>if provided, query will only return those with names matching the filter</p></li>
|
||||
<li><code ng:non-bindable="">options.orderDirection {String} </code>
|
||||
<p>can be <code>Ascending</code> or <code>Descending</code> - Default: <code>Ascending</code></p></li>
|
||||
<li><code ng:non-bindable="">options.orderBy {String} </code>
|
||||
<p>property to order items by, default: <code>SortOrder</code></p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object containing an array of content items.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><h3 id="getScaffold">getScaffold(parentId, alias)</h3>
|
||||
<div class="getscaffold"><p>Returns a scaffold of an empty content item, given the id of the content item to place it underneath and the content type alias.</p>
|
||||
|
||||
<ul>
|
||||
<li>Parent Id must be provided so umbraco knows where to store the content</li>
|
||||
<li>Content Type alias must be provided so umbraco knows which properties to put on the content scaffold </li>
|
||||
</ul>
|
||||
|
||||
<p>The scaffold is used to build editors for content that has not yet been populated with data.</p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.getScaffold(1234, 'homepage')
|
||||
.then(function(scaffold) {
|
||||
var myDoc = scaffold;
|
||||
myDoc.name = "My new document";
|
||||
|
||||
contentResource.publishContent(myDoc, true)
|
||||
.then(function(content){
|
||||
alert("Retrieved, updated and published again");
|
||||
});
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">parentId {Int} </code>
|
||||
<p>id of content item to return</p></li>
|
||||
<li><code ng:non-bindable="">alias {String} </code>
|
||||
<p>contenttype alias to base the scaffold on </p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object containing the content scaffold.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><h3 id="publishContent">publishContent(content, isNew, files)</h3>
|
||||
<div class="publishcontent"><p>Saves and publishes changes made to a content item to a new version, if the content item is new, the isNew paramater must be passed to force creation
|
||||
if the content item needs to have files attached, they must be provided as the files param and passed seperately </p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.getById(1234)
|
||||
.then(function(content) {
|
||||
content.name = "I want a new name, and be published!";
|
||||
contentResource.publishContent(content, false)
|
||||
.then(function(content){
|
||||
alert("Retrieved, updated and published again");
|
||||
});
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">content {Object} </code>
|
||||
<p>The content item object with changes applied</p></li>
|
||||
<li><code ng:non-bindable="">isNew {Bool} </code>
|
||||
<p>set to true to create a new item or to update an existing </p></li>
|
||||
<li><code ng:non-bindable="">files {Array} </code>
|
||||
<p>collection of files for the document </p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object containing the saved content item.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><h3 id="saveContent">saveContent(content, isNew, files)</h3>
|
||||
<div class="savecontent"><p>Saves changes made to a content item to its current version, if the content item is new, the isNew paramater must be passed to force creation
|
||||
if the content item needs to have files attached, they must be provided as the files param and passed seperately </p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
contentResource.getById(1234)
|
||||
.then(function(content) {
|
||||
content.name = "I want a new name!";
|
||||
contentResource.saveContent(content, false)
|
||||
.then(function(content){
|
||||
alert("Retrieved, updated and saved again");
|
||||
});
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">content {Object} </code>
|
||||
<p>The content item object with changes applied</p></li>
|
||||
<li><code ng:non-bindable="">isNew {Bool} </code>
|
||||
<p>set to true to create a new item or to update an existing </p></li>
|
||||
<li><code ng:non-bindable="">files {Array} </code>
|
||||
<p>collection of files for the document </p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object containing the saved content item.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><h3 id="sort">sort(args)</h3>
|
||||
<div class="sort"><p>Sorts all children below a given parent node id, based on a collection of node-ids</p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
var ids = [123,34533,2334,23434];
|
||||
contentResource.sort({ parentId: 1244, sortedIds: ids })
|
||||
.then(function() {
|
||||
$scope.complete = true;
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">args {Object} </code>
|
||||
<p>arguments object</p></li>
|
||||
<li><code ng:non-bindable="">args.parentId {Int} </code>
|
||||
<p>the ID of the parent node</p></li>
|
||||
<li><code ng:non-bindable="">options.sortedIds {Array} </code>
|
||||
<p>array of node IDs as they should be sorted</p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<h1><code ng:non-bindable="">entityResource</code>
|
||||
<span class="hint">(service in module <code ng:non-bindable="">umbraco.resources</code>
|
||||
)</span>
|
||||
</h1>
|
||||
<div><h2 id="Description">Description</h2>
|
||||
<div class="description"><p>Loads in basic data for all entities</p>
|
||||
|
||||
<h2 id="whatisanentity">What is an entity?</h4>
|
||||
|
||||
<p>An entity is a basic <strong>read-only</strong> representation of an Umbraco node. It contains only the most
|
||||
basic properties used to display the item in trees, lists and navigation. </p></div>
|
||||
<div class="member method"><h2 id="Methods">Methods</h2>
|
||||
<ul class="methods"><li><h3 id="getById">getById(id)</h3>
|
||||
<div class="getbyid"><p>Gets an entity with a given id</p>
|
||||
|
||||
<h2 id="usage">usage</h5>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
entityResource.getById(1234)
|
||||
.then(function(ent) {
|
||||
var myDoc = ent;
|
||||
alert('its here!');
|
||||
});
|
||||
</pre> </p><h4 id="Parameters">Parameters</h4>
|
||||
<ul class="parameters"><li><code ng:non-bindable="">id {Int} </code>
|
||||
<p>id of entity to return </p></li>
|
||||
</ul>
|
||||
<h4 id="Returns">Returns</h4>
|
||||
<div class="returns"><code ng:non-bindable="">{Promise}</code>
|
||||
– <p>resourcePromise object containing the entity.</p></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -17,7 +17,7 @@ sure the umbraco.services module is accesible - which it should be by default.</
|
||||
var dialog = dialogService.open({template: 'path/to/page.html', show: true, callback: done});
|
||||
functon done(data){
|
||||
//The dialog has been submitted
|
||||
// data contains whatever the dialog has selected / attached
|
||||
//data contains whatever the dialog has selected / attached
|
||||
}
|
||||
</pre> </p></div>
|
||||
<h2 id="Dependencies">Dependencies</h2>
|
||||
|
||||
@@ -23,7 +23,7 @@ model objects (not user defined). The methods below are named according to these
|
||||
<div class="getfielderror"><p>Gets the error message for a content field</p></div>
|
||||
</li>
|
||||
<li><h3 id="getPropertyCallbacks">getPropertyCallbacks()</h3>
|
||||
<div class="getpropertycallbacks"><p>Gets all callbacks that has been registered using the subscribe method for the contentProperty + fieldName combo.
|
||||
<div class="getpropertycallbacks"><p>Gets all callbacks that has been registered using the subscribe method for the propertyAlias + fieldName combo.
|
||||
This will always return any callbacks registered for just the property (i.e. field name is empty) and for ones with an
|
||||
explicit field name set.</p></div>
|
||||
</li>
|
||||
@@ -54,7 +54,7 @@ This is generally used for server side validation in order to match up a server
|
||||
a particular field, otherwise we can only pinpoint that there is an error for a content property, not the
|
||||
property's specific field. This is used with the val-server directive in which the directive specifies the
|
||||
field alias to listen for.
|
||||
If contentProperty is null, then this subscription is for a field property (not a user defined property).</p></div>
|
||||
If propertyAlias is null, then this subscription is for a field property (not a user defined property).</p></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user