【问题标题】:How to get asset name and the attributes of the asset when we know Asset ID in WCS当我们知道 WCS 中的资产 ID 时,如何获取资产名称和资产的属性
【发布时间】:2018-05-24 08:14:03
【问题描述】:

我能够获得推荐资产中存在的资产 ID 和资产类型。但是,一旦我得到了他们两个。我无法使用资产 ID 或同时使用资产 ID 和资产类型来获取资产名称属性和用户定义的资产属性。下面是代码: 那么如何获取资产名称和资产的用户定义属性呢?

<commercecontext:getrecommendations 
collection='<%=ics.GetVar("op_rec_men_name")%>'
maxcount="10"  listvarname="list_allassets"/>

<br/> Asset Details:

 <ics:listloop listname="list_allassets">

    <ics:listget listname="list_allassets" fieldname="assetid" 
     output="op_assetid"/>
     Asset ID : <%=ics.GetVar("op_assetid")%> <br/> 

    <ics:listget listname="list_allassets" fieldname="assettype" 
    output="op_assettype"/>
    Asset Type: <%=ics.GetVar("op_assettype")%> <br/> 

    <%-- Using Asset Id and Asset Type values and defining "setasset"--%> 
    <assetset:setasset name="msd" type='<%=ics.GetVar("op_assettype")%>' 
    id='<%=ics.GetVar("op_assetid")%>'/>

    <%-- Trying to get value of user-defined attribute "Page_FS2_Int_SV" 
     corresponding to the above Asset Id and Asset Type. This part of code 
     is not working from here --%>
     <assetset:getattributevalues name="msd"  attribute="Page_FS2_Int_SV"  
      listvarname="list_int_sv"  />
      Page_FS2_Int_SV: <string:stream list="list_int_sv" 
      column="namevalue"/> 
      <br/>

      <%-- Tried value as "name", "Name", "assetname" but did not work --%>         
      <assetset:getattributevalues name="msd"  attribute="name"  
      listvarname="list_asset_name"  />
      Asset Name: <string:stream list="list_asset_name" column="namevalue"/> 
      <br/>  

    </ics:listloop>

预期输出:资产名称和资产的用户定义属性的值

我成功获得了资产 ID 和资产类型,但没有获得资产名称和资产的用户定义属性的值。

查询:那么我如何获取资产名称和资产的用户定义属性的值?

【问题讨论】:

  • 下面是代码:

标签: webcenter webcenter-sites


【解决方案1】:

您需要在assetset:getattributevalues 标签中指定typename 属性。您可以调试您的代码以验证相同,只需插入:

<ics:clearerrno/>
<assetset:getattributevalues .....>
<ics:geterrno/>

这应该打印错误号,告诉您您缺少在标签中包含属性!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-29
    • 2023-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多