我为从Sitefinity CMS提取数据的客户构建Web服务。问题是他们想要传入服务的Guid并接收有关此项目的信息。没问题,除了我只能找到" live"指导一个项目(这是通过后端的HTML梳理)。
我打算查看SQL Server中的表,但我不确定要查看哪个表。当然,内容项目有几个相关的表格,并且没有关于如何查看此内容的任何文档。我可以找到大量关于查询主Guid的文档,但没有找到它的地方。
哦,这些是由Module Builder构建的自定义内容类型。
任何帮助都会受到赞赏!
答案 0 :(得分:2)
Sitefinity网络服务的最大消费者之一是Sitefinity。开始寻找guid的最佳位置是查看在后端提取自定义内容项列表时正在进行的Web服务调用。我使用了chrome开发人员工具并检查了网络选项卡。
的效果返回的json是包含其ID的所有主人的列表(在列表中注意,内容项的状态均为0)http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/modules/content-lifecycle
答案 1 :(得分:2)
var master = DynamicModuleManager.GetManager().Lifecycle.GetMaster(<liveGuidHere>);
答案 2 :(得分:0)
当您转到管理/模块构建器/您的模块时,您会在右上角看到指向API的链接。
此链接转到一个完整的您的特定模块的API示例页面,这很酷。
基本上,您必须首先使用LINQ和GetValue扩展方法找到您的项目。 一旦您拥有该项目,您就可以获得其ID或任何其他财产。
using Telerik.Sitefinity.Utilities.TypeConverters;
using Telerik.Sitefinity.DynamicModules;
using Telerik.Sitefinity.Model;
....
var mgr = DynamicModuleManager.GetManager();
var countrymasters = from ctry in mgr.GetDataItems(TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Destinations.Destination"))
where ctry.GetValue<string>("culture") == siteid &&
(ctry.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ctry.Visible == true)
select new
{
airport_cd = ctry.GetValue<string>("airport_cd"),
country_master_cd = ctry.GetValue<string>("country_master_cd")
};