我已经在Visual Studio中为SDL Tridion 2011 SP1上的CD OData webservice生成了一个服务引用,一切似乎都运行正常,但是当我请求具有以下代码的特定组件时:
ContentDeliveryService cdService1 = new ContentDeliveryService(new Uri("http://xxx:81/odata.svc"));
var item = cdService1.Components.Where(p => p.ItemId == 29 && p.PublicationId == 1).First();
Console.WriteLine(item.ItemId);
Run Code Online (Sandbox Code Playgroud)
抛出异常:
The closed type ConsoleApplication1.CdService.Component does not have a corresponding IsMultimedia settable property.
Run Code Online (Sandbox Code Playgroud)
有人知道热修复吗?
我有一个非常简单的代码的cs文件:
using Ionic.Zip;
public static class Helper
{
public static ZipFile GetNewFile(string fileName)
{
return new ZipFile(fileName);
}
}
Run Code Online (Sandbox Code Playgroud)
它需要Ionic.Zip组装.我想将此类型添加到我的powershell中,如下所示:
cd c:\pst
Add-Type -Path "2.cs" -ReferencedAssemblies "Ionic.Zip.dll"
$var = [Helper]::GetNewFile("aaa")
Run Code Online (Sandbox Code Playgroud)
当我这样做时它给了我:
The following exception occurred while retrieving member "GetNewFile": "Could not load file or assembly 'Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' or one of its dependencies. The located assembly'
s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
Run Code Online (Sandbox Code Playgroud)
它似乎已经在某个临时位置编译了程序集,并且在那里找不到Ionic.Zip.
但是,如果指定输出程序集然后添加此程序集,则它可以正常工作:
cd c:\pst
Add-Type -Path "2.cs" -ReferencedAssemblies "Ionic.Zip.dll" -OutputAssembly …Run Code Online (Sandbox Code Playgroud) 在我的C#或Dreamweaver模板中,我需要知道我在渲染什么.问题是我不确定我是否在寻找页面或组件.我可以使用package.GetByType(ContentType.Page),如果它是空的 - 获取组件的内容,但我觉得应该有一个更短的方式.
大卫的例子更短:
engine.PublishingContext.ResolvedItem.Item.Id
Run Code Online (Sandbox Code Playgroud) 有人能指出我设置Broker API以供.Net应用程序使用的文档吗?我已经查看了有关livecontent的文档,但是我没有看到有关设置和配置要从.net项目使用的代理API的具体内容:文档都与服务器有关.
我试图通过查看OData服务的设置方式将其拼凑在一起,但我不断收到下面列出的错误.所以我错过了一步,但是步骤是什么?我是否需要更新一些CD _*_ CONF.xml配置文件?
还有一个问题.是我还是Tridion文档有些不完整?如何使用产品的关键API之一的基本说明似乎是一个合理的请求.如果这份文件存在,我提前道歉,但我错过了.
我得到的错误
无法初始化类com.tridion.storage.StorageManagerFactory
要么
ClassNotFoundException:com.tridion.broker.querying.Query
UPDATE
感谢您及时的回复.我查看了"将服务器角色安装为.net ..."一文.看起来我已按照步骤操作但我的应用程序找不到JAR文件.在这种情况下,cd_broker.jar位于我的.net项目的root/bin/lib目录中
Java.Lang.ClassNotFoundException:com.tridion.broker.querying.Query
更新2
我正在使用Tridion 2011 SP1.
在使用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) 我是Tridion Event System的新手.我写了一个小代码.
[TcmExtension("MyEventHandlerExtension")]
public class EH : TcmExtension
{
public EH()
{
Subscribe();
}
public void Subscribe()
{
//EventSystem.Subscribe<Component, DeleteEventArgs>(HandlerForInitiated, EventPhases.Initiated);
EventSystem.Subscribe<Tridion.ContentManager.CommunicationManagement.Page, Tridion.ContentManager.Extensibility.Events.PublishOrUnPublishEventArgs>(HandlerForCommitted, EventPhases.All);
}
private void HandlerForCommitted(IdentifiableObject subject, PublishOrUnPublishEventArgs args, EventPhases phase)
{
TDSE obj = new TDSE();
Tridion.ContentManager.Interop.TDS.Publication pub = obj.GetPublication("tcm:0-150-1");
Tridion.ContentManager.Interop.TDS.Page pubPage = obj.GetPage("tcm:150-12374-64", pub);
pubPage.Publish("tcm:0-1-65538", false, true, false, default(DateTime), default(DateTime), default(DateTime));
}
}
Run Code Online (Sandbox Code Playgroud)
使用此代码我希望每次发生发布和取消发布事件时都发布一个页面.我构建此代码并在tridion配置文件中注册其路径.但它没有用.请帮助
我出于某些原因需要自定义我的部署程序,我只能看到一些使用java进行自定义部署的文章.
我们可以使用.NET项目自定义部署者,请分享您的想法,如果可能的话,一些解决方案.
我有2个对象A和B. B继承自A并具有更多属性.我有IEnumerable {A}只包含B对象.我想做的是:
list.Single(b => b.PropertyThatOnlyExistOnB == "something")
Run Code Online (Sandbox Code Playgroud)
我希望这样的事情能够发挥作用:
list.Single((B) b => b.PropertyThatOnlyExistOnB == "something")
Run Code Online (Sandbox Code Playgroud)
但它没有编译.现在我只是这样做:
B result = null;
foreach (b in list)
{
if((B)b.PropertyThatOnlyExistOnB == "something")
{
result = (B)b;
}
}
Run Code Online (Sandbox Code Playgroud)
有更短的方式吗?谢谢