SED流编辑器是否有.NET端口?理想情况下,它将是开源的,但是在此阶段,我不排除任何问题。
我已经用谷歌搜索了这个,没有任何明显的成功,所以这里的第二个问题是:创建一个要困难多少?
我假设SED的来源在C中。如果我的主要问题的答案是“否”,那么将此类项目移植到C#的指针/策略将不胜感激。
我们正在尝试映射一个对象 - 一个Tridion Outbound Email Contact - 它有一个带有内部构造函数的自定义字典类型属性 - ExtendedDetailCollection
从对象到Viewmodel的精细映射
Mapper.CreateMap<Contact,ContactViewModel>()
.ForMember(x=>x.Name, m=>m.MapFrom(x=>x.ExtendedDetails["Name"].StringValue))
Run Code Online (Sandbox Code Playgroud)
但另一种方式不起作用
我们尝试过:
Mapper.CreateMap<ContactViewModel,Contact>()
.ForMember(x=>x.ExtendedDetails["Name"].Value, m => m.MapFrom(x=>x.Name));
Run Code Online (Sandbox Code Playgroud)
但是会引发运行时异常.
编辑:异常的消息是:
AutoMapper.AutoMapperConfigurationException:仅对类型上的顶级单个成员支持成员的自定义配置.
我们还尝试了各种类型的转换器和值解析器,但是没有一个允许我们获取被映射到的对象,这是我们需要访问以映射ExtendedDetails对象.
Mapper.CreateMap<ContactViewModel,Contact>()
.ForMember(x=>x.ExtendedDetails, m => ????);
Run Code Online (Sandbox Code Playgroud)
是否有这样的模式或使用静态方法更容易?
我通过发布的客户端程序集调用Tridion 2011 SP1核心服务.当我尝试列出出版物的内容时,我得到一个例外.
代码(简化)如下所示:
ItemsFilterData filter = new Tridion.ContentManager.CoreService
.Client.RepositoryItemsFilterData.RepositoryItemsFilterData();
filter.ItemTypes = new ItemType[] {
ItemType.Folder,
ItemType.StructureGroup
};
filter.Recursive = false;
IEnumerable<IdentifiableObjectData> childItems = core.GetList("tcm:0-15-1", filter);
Run Code Online (Sandbox Code Playgroud)
注意:变量"core"指的是我可以成功调用的ISessionAwareCoreService,例如core.GetSystemWideList()
当调用.GetList时,我得到以下异常:
System.ServiceModel.FaultException`1 was unhandled
Message=Unexpected list type:
Tridion.ContentManager.Data.ContentManagement.RepositoryItemsFilterData.
Run Code Online (Sandbox Code Playgroud)
这个问题的可能原因是什么?你能否提出一个很好的通用方法来解释这种信息?
在使用Web浏览器测试我的Tridion内容交付Web服务时,我可以通过调用"http://webservice/odata.svc/"成功获取可用集合的列表,但是当我尝试访问其中一个集合时,例;
http://webservice/odata.svc/Publications
Run Code Online (Sandbox Code Playgroud)
我明白了
<message xml:lang="en-US">Unable to retrieve desired results.</message>
Run Code Online (Sandbox Code Playgroud)
或特定项目
http://webservice/odata.svc/Publications(19)
Run Code Online (Sandbox Code Playgroud)
我明白了:
<message xml:lang="en-US">Unable to build publication entry:
Unable to retrieve desired results.</message>
Run Code Online (Sandbox Code Playgroud)
在日志中,我得到以下内容(我删除了时间戳等,使其更具可读性):
ODataService - ODATA.NET: Resource retrieval: Publications
WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore@576504fa, thread: Thread-5
ODataWebserviceHandler - Requested a OData feed/entry: Publications with type: application/atom+xml
ODataWebserviceHandler - Setting $top to 25
ResolverBase - Requested OData collection
StorageManagerFactory - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0 / Query / null
JPQLExecutor - Can not create JPAQueryDAO object
com.tridion.broker.StorageException: No …Run Code Online (Sandbox Code Playgroud) 我想通过将文件扩展名作为参数传递给方法来获取多媒体类型的TCM URI.下面是我正在使用的代码,但我得到一些例外: -
private static string GetMultimediaTypeTCMURI(FileExtensionsList lFileExtensions)
{
string lTCMURI = "";
try
{
SessionAwareCoreService2010Client client
= new SessionAwareCoreService2010Client();
client.ClientCredentials.Windows.ClientCredential.UserName = "myUserName";
client.ClientCredentials.Windows.ClientCredential.Password = "myPassword";
client.Open();
FileExtensionsList list = new FileExtensionsList();
var mmType = client.GetSystemWideList(new MultimediaTypesFilterData())
.Single(mt => ((MultimediaTypeData)mt).FileExtensions == lFileExtensions);
lTCMURI = mmType.Id;
}
catch (Exception e)
{
throw new Exception("Please check either Mimetype"
+ lFileExtensions + "is wrong or Mimetype does not exist in SDL Tridion.");
}
return lTCMURI;
}
Run Code Online (Sandbox Code Playgroud)
致电上述方法: -
FileExtensionsList list = new FileExtensionsList(); …Run Code Online (Sandbox Code Playgroud) 我有一个用例,我需要添加有关创建当前发布事务的用户的信息(不仅仅是他们的用户名,我还需要组成员资格和其他一些细节)并将其传递给部署者扩展.
使用以下代码发布时相对容易
engine.PublishingContext.RenderedItem.AddInstruction(
InstructionScope.Global, instruction);
Run Code Online (Sandbox Code Playgroud)
您可能会注意到此方法"AddInstruction"仅适用于"RenderedItem",但Unpublish指令不会呈现项目,因此我无法使用相同的技术.
如果没有在生成文件系统时破解文件系统中的软件包清单(例如在自定义解析程序中),您将如何处理此要求?
我为用户生成的内容配置了Tridion,并使用默认/演示模板创建了一个网页,该模板使用文本输入字段来提供评论作者的姓名.注释被接受,但在显示时,它们将用户的名称显示为"null".我认为问题在于存储名称,而不是检索它.如果我在Content Manager UI中创建注释,然后返回到我的测试网页,则会显示注释,其中包含主持人的姓名.
面向公众的UGC Web服务配置了AllowAnonymousClaimProcessor.(如果没有这个,评论根本不会保存.)日志记录显示这显然成功地将缺少的taf:claim:contentdelivery:webservice:user转换为基于跟踪ID的用户.
当然,这个想法不是将其用作评论的作者.在日志记录中,您还可以看到来自网页中文本输入的字符串"测试用户",并且这似乎映射到author=com.tridion.storage.ugc.UGCUser@2598a35d,但不久之后存储层搜索ID为null的用户并找到一个.
我怀疑这是一个配置问题,但正如你所看到的,它很复杂,而且我不确定在哪里可以进一步查看.关于它应该如何工作的解释将与进行实验的更具体的建议一样受欢迎.
记录输出如下.我已经修剪了很多但是它仍然很长,因为我不知道哪些位可能证明相关:
2012-06-03 13:00:10,662 WARN AmbientDataContext - There is no current ambient data context - the ambient data framework is not properly initialised
2012-06-03 13:00:10,668 DEBUG AmbientDataContext - Setting current ambient data context: com.tridion.ambientdata.web.WebContext
2012-06-03 13:00:10,903 DEBUG ClaimStore - put: uri=taf:response:cookie:generation, value=true
2012-06-03 13:00:10,906 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore@483a0ab1, thread: Thread-1
2012-06-03 13:00:10,922 DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/ItemStats(PublicationId=19,Id=320,Type=16)
2012-06-03 13:00:10,923 DEBUG ClaimStore - put: uri=taf:request:full_url, value=http://cdweb.visitorsweb.local/odata.svc/ItemStats(PublicationId=19,Id=320,Type=16)
2012-06-03 13:00:10,936 DEBUG ClaimStore - put: uri=taf:request:headers, …Run Code Online (Sandbox Code Playgroud) 我正在使用.NET Templating C#2.0开发Tridon 2009
我需要从文件夹及其子文件夹中读取所有组件.
如果在我的代码中我写道:
OrganizationalItem imageFolder =
(OrganizationalItem)m_Engine.GetObject(comp.OrganizationalItem.Id);
Run Code Online (Sandbox Code Playgroud)
我能够从指示器组件所在的位置读取子文件夹中的所有组件,但是我无法读取存在指示符的文件夹中存在的其他组件.
但如果我写
OrganizationalItem imageFolder = (OrganizationalItem)m_Engine.GetObject(
comp.OrganizationalItem.OrganizationalItem.Id);
Run Code Online (Sandbox Code Playgroud)
然后我只能读取指示器组件所在的文件夹.
以下是我的代码.
XmlDocument doc = xBase.createNewXmlDocRoot("ImageLibrary");
XmlElement root = doc.DocumentElement;
Filter filter = new Filter();
Component comp = this.GetComponent();
filter.Conditions["ItemType"] = ItemType.Folder;
filter.Conditions["Recursive"] = "true";
OrganizationalItem imageFolder =
(OrganizationalItem)m_Engine.GetObject(comp.OrganizationalItem.Id);
XmlElement itemList = imageFolder.GetListItems(filter);
foreach (XmlElement itemImg in itemList)
{
filter.Conditions["ItemType"] = ItemType.Component;
filter.Conditions["BasedOnSchema"] = comp.Schema.Id;
OrganizationalItem imgFolder =
(OrganizationalItem)m_Engine.GetObject(itemImg.GetAttribute("ID")
.ToString());
XmlElement imageLibs = imgFolder.GetListItems(filter);
doc = this.createImageNodes(imageLibs, doc, filter, comp);
foreach (XmlElement imglib …Run Code Online (Sandbox Code Playgroud) 我正在尝试获取工作流程过程历史记录项的每个活动的批准状态,如下所示.
var status = csClient.Read(activitiydetails.Id, readoption) as ApprovalStatusData;
logdetails("Activity Approval Status--->" + status.Title.ToString());
Run Code Online (Sandbox Code Playgroud)
我收到"对象引用错误"
我正在尝试在SDL Tridion 2011 Sp1中实现Razor调解器.
可以任何人建议一些有用的链接.
谢谢
tridion ×9
c# ×3
tridion-2011 ×3
.net ×2
automapper ×1
porting ×1
sed ×1
tridion2009 ×1
ugc ×1