RAM API RAMAsset.setDescription - how can we set multi-line Long Description in an asset via API?
We are trying to read a text file, and set the contents of that file as the Long Description in a RAM Asset via API calls. But, when we do this, all of the line endings are lost so that the Description contains one long line consisting of all lines concatenated together. We've done some testing, trying to pass strings containing "\n" or "\r\n", but are unable to get this working.
Is there some special syntax to use to insert line endings into the Long Description? Here is what we have been trying.......... String LongDesc = "Line1\nLine2\nLine3\n"; System.out.println(LongDesc); asset.setDescription(LongDesc); But, here is what the Description looks like in the asset after running this......... |
Accepted answer
Hi,
long description in RAM is rich text. I think one could use html elements in description. As to your case, try this one in your code: asset.setDescription("<p>lin1</p><p>lin3</p><p>lin4</p>"); Thanks. Troy Klomp selected this answer as the correct answer
Comments comment hided the html element in my comment, it should be:
asset.setDescription("lin1<br>line2<br>");
Troy Klomp
commented May 20 '14, 1:02 p.m.
Thank you Lu! This does what we need at this point. It's good to know that we could put more html out there as well.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.