From bc23f4e150865fdad5bbb42d59502be77edd857e Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Fri, 15 Jun 2012 22:46:34 +0100 Subject: [PATCH 1/2] Initial uQuery structure and methods --- .../Reference/Querying/uQuery/index.md | 119 +++++++++++++++--- 1 file changed, 104 insertions(+), 15 deletions(-) diff --git a/Documentation/Reference/Querying/uQuery/index.md b/Documentation/Reference/Querying/uQuery/index.md index da19ca54af8..5532d29a4fe 100644 --- a/Documentation/Reference/Querying/uQuery/index.md +++ b/Documentation/Reference/Querying/uQuery/index.md @@ -1,15 +1,104 @@ -#This section is waiting for content - -This documention has not been written yet, but it is on the roadmap. - -###Progress -Consult the Umbraco 4 documentation trello board to see what we are currently working on. -[See the TrelloBoard here](https://trello.com/board/umbraco-4-documentation/4fdb02df8fc3ef067e809e95) - -###Contribution -Umbraco is a community powered project and we welcome any contribution, big or small, even fixing a typo is a valuable contribution. -[See how to contribute](https://github.com/umbraco/Umbraco4Docs) - - - - \ No newline at end of file +# uQuery + +uQuery is an API giving read and write access the content, media and member data, as well as extending the relations API. uQuery originated from uComponents and was added into Umbraco from v4.8, and can be accessed by referencing the umbraco namespace: + +`using umbraco;` + +## Content + +Querying content can be done via 'Nodes' where the source data comes from the Xml cache (the current published version), or via 'Documents' where the data is retrieved from the database (which is slower, but the data represents the latest version whether it's published or not). + +uQuery has a number of static methods to get collections of Nodes and Documents, as well as extension methods on the umbraco.NodeFactory.Node / umbraco.cms.Web.Document objects. + +### Items +#### GetRootNode +#### GetCurrentNode +#### GetCurrentDocument +#### GetNode +#### GetDocument + +### Collections +#### GetNodesByCsv +#### GetDocumentsByCsv +#### GetNodesByXml +#### GetDocumentsByXml +#### GetNodesByXPath +#### GetNodesByName +#### GetNodesByType +#### GetNodeByUrl + +### Traversing +#### GetAncestorNodes +#### GetAncestorDocuments +#### GetAncestorOrSelfNodes +#### GetAncestorOrSelfDocuments +#### GetPreceedingSiblingNodes +#### GetPreceedingSiblingDocuments +#### GetFollowingSiblingNodes +#### GetFollowingSiblingDocuments +#### GetSiblingNodes +#### GetSiblingDocuments +#### GetDescendantNodes +#### GetDescendantDocuments +#### GetDescendantOrSelfNodes +#### GetDescendantOrSelfDocuments +#### GetChildNodes +#### GetChildDocuments + +### Properties +#### HasProperty +#### GetProperty +#### SetProperty + +## Media ## + +### Items +#### GetMedia + +### Collections +#### GetMediaByXPath +#### GetMediaByCsv +#### GetMediaByXml +#### GetMediaByName +#### GetMediaByType + +### Traversing +#### GetAncestorMedia +#### GetAncestorOfSelfMedia +#### GetPrecedingSiblingMedia* +#### GetFollowingSiblingMedia* +#### GetSiblingMedia +#### GetDescendantMedia +#### GetDescendantOrSelfMedia +#### GetChildMedia + +### Properties +#### HasProperty +#### GetProperty +#### SetProperty + +## Members ## + +### Items +#### GetMember + +### Collections +#### GetMembersByXPath +#### GetMembersByCsv +#### GetMembersByXml +#### GetMembersByType +#### GetMembersByGroup + +### Properties +#### HasProperty +#### GetProperty +#### SetProperty + +## Relations ## + +#### HasRelations +#### IsRelated +#### GetRelation +#### GetRelations +#### DeleteRelation +#### ClearRelations \ No newline at end of file From 7bfe3fb80684ece43e496ce0f7b0408876c698f6 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Fri, 15 Jun 2012 23:00:56 +0100 Subject: [PATCH 2/2] Added some horizontal rules to break sections up --- .../Reference/Querying/uQuery/index.md | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/Documentation/Reference/Querying/uQuery/index.md b/Documentation/Reference/Querying/uQuery/index.md index 5532d29a4fe..fdc602fa18e 100644 --- a/Documentation/Reference/Querying/uQuery/index.md +++ b/Documentation/Reference/Querying/uQuery/index.md @@ -1,6 +1,6 @@ # uQuery -uQuery is an API giving read and write access the content, media and member data, as well as extending the relations API. uQuery originated from uComponents and was added into Umbraco from v4.8, and can be accessed by referencing the umbraco namespace: +uQuery is an API giving read and write access the content, media and member data, as well as extending the relations built in API. uQuery originated from uComponents and was added into Umbraco from v4.8, and can be accessed by referencing the umbraco namespace: `using umbraco;` @@ -10,14 +10,20 @@ Querying content can be done via 'Nodes' where the source data comes from the Xm uQuery has a number of static methods to get collections of Nodes and Documents, as well as extension methods on the umbraco.NodeFactory.Node / umbraco.cms.Web.Document objects. +---- + ### Items + #### GetRootNode #### GetCurrentNode #### GetCurrentDocument #### GetNode #### GetDocument +---- + ### Collections + #### GetNodesByCsv #### GetDocumentsByCsv #### GetNodesByXml @@ -27,7 +33,10 @@ uQuery has a number of static methods to get collections of Nodes and Documents, #### GetNodesByType #### GetNodeByUrl +---- + ### Traversing + #### GetAncestorNodes #### GetAncestorDocuments #### GetAncestorOrSelfNodes @@ -45,16 +54,25 @@ uQuery has a number of static methods to get collections of Nodes and Documents, #### GetChildNodes #### GetChildDocuments +---- + ### Properties #### HasProperty #### GetProperty #### SetProperty +---- + ## Media ## +Querying media intro + +---- ### Items #### GetMedia +---- + ### Collections #### GetMediaByXPath #### GetMediaByCsv @@ -62,6 +80,8 @@ uQuery has a number of static methods to get collections of Nodes and Documents, #### GetMediaByName #### GetMediaByType +---- + ### Traversing #### GetAncestorMedia #### GetAncestorOfSelfMedia @@ -72,16 +92,26 @@ uQuery has a number of static methods to get collections of Nodes and Documents, #### GetDescendantOrSelfMedia #### GetChildMedia +---- + ### Properties #### HasProperty #### GetProperty #### SetProperty +---- + ## Members ## +Querying members into + +---- + ### Items #### GetMember +---- + ### Collections #### GetMembersByXPath #### GetMembersByCsv @@ -89,12 +119,21 @@ uQuery has a number of static methods to get collections of Nodes and Documents, #### GetMembersByType #### GetMembersByGroup +---- + ### Properties #### HasProperty #### GetProperty #### SetProperty +---- + ## Relations ## +Releation methods intro + +---- + +### Methods #### HasRelations #### IsRelated