tridion 2009 - 将多媒体组件从一个出版物复制到另一个出版物

use*_*140 4 multimedia tridion

如何在2009年使用api将图像组件从一个出版物复制到另一个出版物?

这可能吗?我试过用

    newComponent.Multimedia.SetUploadedMultimediaFilename(originalComponent.Multimedia.Filename);
Run Code Online (Sandbox Code Playgroud)

+ newComponent.save(); 我的newComponent是我从原始组件创建的那个.

    <tcm:Error xmlns:tcm="http://www.tridion.com/ContentManager/5.0"                                                         ErrorCode="80040325" Category="3" Source="Kernel" Severity="2">
    - <tcm:Line ErrorCode="80040325" Cause="false" MessageID="16137">
    - <![CDATA[ Unable to save Component (tcm:0-0-0).
      ]]> 
      <tcm:Token>RESID_4574</tcm:Token> 
      <tcm:Token>RESID_4418</tcm:Token> 
      <tcm:Token>tcm:0-0-0</tcm:Token> 
      </tcm:Line>
    - <tcm:Line ErrorCode="80040325" Cause="true" MessageID="16010">
    - <![CDATA[ Operation is not supported on a new item (or on a null URI).
      ]]> 
      </tcm:Line>
    - <tcm:Details>
    - <tcm:CallStack>
      <tcm:Location>UtilitiesBL.AssertValidURI</tcm:Location> 
      <tcm:Location>ComponentBL.CheckMultiMediaProperties</tcm:Location> 
      <tcm:Location>ComponentBL.Create</tcm:Location> 
      <tcm:Location>XMLState.Save</tcm:Location> 
      <tcm:Location>Component.Save</tcm:Location> 
      </tcm:CallStack>
      </tcm:Details>
      </tcm:Error>
Run Code Online (Sandbox Code Playgroud)

Nun*_*res 5

这不起作用......您需要先将多媒体项保存到文件位置,然后使用此位置从中上传.你现在正在做的就是告诉Tridion有一个文件originalComponent.Multimedia.Filename可能会或可能不是真的.

ñ