2 Replies Latest reply: May 28, 2013 2:22 PM by krishna_pandurangan RSS

    Use Sites API Create Asset can't display in WEM

    1003480
      I use API create asset,the code write in CSElement like that:


      <user:su password="1234569mm" username="kdashany">
      <%
           try{
           Session ses =SessionFactory.getSession(ics);
           AssetDataManager manager=(AssetDataManager)ses.getManager(AssetDataManager.class.getName());
           MutableAssetData assetData=manager.newAssetData("AVIArticle","校友私信资产");
           assetData.getAttributeData("name").setData(ics.GetSSVar("username")+System.currentTimeMillis());
           assetData.getAttributeData("alu_body").setData("11111...");
           assetData.getAttributeData("alu_receiver").setData(ics.GetSSVar("username"));
           assetData.setParents(Arrays.<AssetId>asList(new AssetIdImpl("ArticleCategory",1363163302807L)));
           manager.insert(Arrays.<AssetData>asList(assetData));
           }catch(Exception e){
                e.printStackTrace();
           }
      %>
      </user:su>


      problem is when I login in contributor call the CSElement,the new can display in contributor ,but i don't login in contributor call the CSElement ,although the asset is created and had data in database ,but it can't display in contributor .Use API Query and Write the new, there is no problem.if the code Lack of what,How to solve?Thank You!

      Edited by: 1000477 on Apr 16, 2013 7:02 PM

      Edited by: 1000477 on Apr 16, 2013 7:03 PM

      Edited by: 1000477 on Apr 16, 2013 7:07 PM