一把umbraco:节点,DynamicNode,内容之间的差异 [英] Umbraco: differences between Node, DynamicNode, Content

查看:118
本文介绍了一把umbraco:节点,DynamicNode,内容之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

然后有很多类,它表示一把umbraco文件:

  1)umbraco.cms.businesslogic.Content 
2)umbraco.cms.businesslogic.web.Document
3)umbraco.MacroEngines.DynamicNode
4)umbraco.presentation.nodeFactory.Node

是否有任何其他方面?



你能解释他们做什么,以及何时使用它们?



umbraco.MacroEngines.DynamicNode 的和的 umbraco.presentation.nodeFactory.Node 的似乎是相同的。 ?也许是更好地使用Node类,因为它更快



我有一个理论:



umbraco.cms.businesslogic.Content umbraco.cms.businesslogic.web.Document 是代表性的 cmsContent cmsDocument 数据库表。



umbraco.presentation.nodeFactory.Node umbraco.MacroEngines.DynamicNode 表示在节点缓存XML文件,利用进入网站。
中的第一个是简单的节点,第二个是同一节点添加了动态属性,一个用于在节点类型定义的属性。
所以,我觉得节点 DynamicNode



更快存在有人可以证实这一点?


解决方案

根据个人的使用:




  1. 内容:不要直接使用它,而不是使用文档|新闻|会员API(它从该类继承)

  2. 文件:使用它创建|更新|删除操作。它所有的运作直接为DB,所以应该只用于阅读,当你从数据库中需要值直接

  3. 节点:使用这种最:读的时候|显示数据通过用户控件,代码库,XSLT扩展等

  4. DynamicNode:剃刀宏。我还没有使用这一项足以提供更多的信息。



请参阅下面的更多细节,但没有,节点和DynamicNode不相同的(DynamicNode使用检查,也将回落到从如果需要,DB读)。




umbraco.cms.businesslogic .Content:
含量CMSNode和类将使用通用的数据之间的中间层。内容是持有其相应的ContentType定义的一般数据的数据结构。内容可以在一些SENCE进行比较,以在一个数据库表中的行,其的ContentType持有的列的定义和内容中包含的数据。请注意,内容数据一把umbraco是的的表格,但在treestructure。




我从未有过的需要使用这个类直接虽然,因为所有的操作都是由相应的子类,如处理:文档,媒体成员。该类轮流从CMSNode这对每一块内容数据的内部一把umbraco




umbraco.cms.businesslogic的基类继承.web.Document :文件是一个网页,发布的文档暴露在运行时/在公众网站上缓存的XML文档中的




引用从内容部分节点时使用这个类。它可以处理CRUD操作。通过这个类,你还可以得到每个属性的数据类型的引用的情况下,要呈现在一个aspx页面的控制。




< STRONG> umbraco.NodeFactory.Node :它实现inode的接口,该接口公开只读方式。它的所有信息来源于一把umbraco缓存XML。您将不能访问每个属性的控制,而每个取决于数据类型格式化。


的值

您只能使用这个类读取操作。这使得它非常快,显示数据,因为一切都从缓存中(仅公布节点)。




umbraco.MacroEngines.DynamicNode :它是实现剃刀宏工作。它采用NodeFactory引擎盖,这意味着它也访问缓存XML之下。但如果你使用相关的DynamicMedia要小心,因为它使用:1:ExamineIndex剥离了任何HTML标记,2:它属于回其默认介质类型(DB如果它不能在运行缓存)在umbraco_v4.11.5 <。 / p>


同上。


Then there are many class that represents Umbraco documents:

1) umbraco.cms.businesslogic.Content
2) umbraco.cms.businesslogic.web.Document
3) umbraco.MacroEngines.DynamicNode
4) umbraco.presentation.nodeFactory.Node

Are there any others?

Can you explain what they do, and when to use them?

umbraco.MacroEngines.DynamicNode and umbraco.presentation.nodeFactory.Node seem the same. Perhaps it is better to use Node class because it is faster?

I have a theory:

umbraco.cms.businesslogic.Content and umbraco.cms.businesslogic.web.Document are the representation of cmsContent and cmsDocument DB tables.

umbraco.presentation.nodeFactory.Node and umbraco.MacroEngines.DynamicNode represents the node cached in XML file, to utilize into website. The first is the simply Node, the second is the same Node with added dynamic properties, one for property defined in nodeType. So, I think that Node is faster than DynamicNode

Is there someone that can confirm this?

解决方案

Based on personal use:

  1. Content: Never use it directly, rather use the Document|Media|Member api (which inherits from this class).
  2. Document: Use it for Create|Update|Delete operations. It does all of its operation directly to DB, so it should be used for Reading only when you need to values directly from the db.
  3. Node: Use this most: when Reading|Displaying data through usercontrols, code libraries, xslt extensions, etc.
  4. DynamicNode: Razor macros. I have not yet use this one enough to provide more info.

See below for more detail, but no, Node and DynamicNode are not the same (DynamicNode uses Examine and will also fall back to reading from the DB if needed).

umbraco.cms.businesslogic.Content: Content is an intermediate layer between CMSNode and classes which will use generic data. Content is a datastructure that holds generic data defined in its corresponding ContentType. Content can in some sence be compared to a row in a database table, its ContentType holds a definition of the columns and the Content contains the data. Note that Content data in umbraco is not tabular but in a treestructure.

I have never had the need to use this class directly though, as all of its operations are handled by the corresponding subclass, e.g: Document, Media, Member. This class in turns inherits from CMSNode which is the base class for every piece of content data inside umbraco

umbraco.cms.businesslogic.web.Document:Document represents a webpage, published Documents are exposed to the runtime/the public website in a cached xml document.

Use this class when referencing nodes from your "Content Section". It handles CRUD operations. Through this class you also get a reference to the DataType of each property in case you want to render those controls in an aspx page.

umbraco.NodeFactory.Node: It implements the INode interface which exposes read-only methods. All of its information comes from the umbraco cached xml. You will not get access to the controls of each property, rather the values of each formatted depending on the datatype.

You can only use this class for reading operations. It makes it really fast to show data since everything comes from cache (published nodes only).

umbraco.MacroEngines.DynamicNode: It was implemented to work with razor macros. It uses NodeFactory under the hood, which means it also access the cached xml. Although if you use the related DynamicMedia be careful as it uses: 1: ExamineIndex which strips out any html tags, 2: it falls back to its default Media type (db if it isn't in runtime cache) in umbraco_v4.11.5.

Same as the above.

这篇关于一把umbraco:节点,DynamicNode,内容之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆